{"action":"created","issue":{"url":"https://api.github.com/repos/cran/MUS/issues/1","repository_url":"https://api.github.com/repos/cran/MUS","labels_url":"https://api.github.com/repos/cran/MUS/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/cran/MUS/issues/1/comments","events_url":"https://api.github.com/repos/cran/MUS/issues/1/events","html_url":"https://github.com/cran/MUS/pull/1","id":373365089,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MzEwNzAz","number":1,"title":"Bug in MUS::MUS.calc.n.conservative (Result is wrong)","user":{"login":"kiwimic","id":16867074,"node_id":"MDQ6VXNlcjE2ODY3MDc0","avatar_url":"https://avatars3.githubusercontent.com/u/16867074?v=4","gravatar_id":"","url":"https://api.github.com/users/kiwimic","html_url":"https://github.com/kiwimic","followers_url":"https://api.github.com/users/kiwimic/followers","following_url":"https://api.github.com/users/kiwimic/following{/other_user}","gists_url":"https://api.github.com/users/kiwimic/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwimic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwimic/subscriptions","organizations_url":"https://api.github.com/users/kiwimic/orgs","repos_url":"https://api.github.com/users/kiwimic/repos","events_url":"https://api.github.com/users/kiwimic/events{/privacy}","received_events_url":"https://api.github.com/users/kiwimic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-24T08:33:01Z","updated_at":"2018-10-24T08:47:52Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/cran/MUS/pulls/1","html_url":"https://github.com/cran/MUS/pull/1","diff_url":"https://github.com/cran/MUS/pull/1.diff","patch_url":"https://github.com/cran/MUS/pull/1.patch"},"body":"I just got to know your package, I was looking for an implementation in R MUS algorithm (especially MUS.factor (confidence.level, pct.ratio)), when I used MUS.factor (confidence.level, pct.ratio) I came across a strange result (practically always trying was 1). When I examined the function, it turned out that there are missing parentheses to divide)\r\n\r\n```r\r\nlibrary(MUS)\r\n\r\n\r\nMUS.calc.n.conservative_VERSION_FROM_PACKAGE_CRAN_AND_GITHUB <- function(confidence.level, tolerable.error, expected.error, book.value) {\r\n  # calculate n consevatively, as per AICPA audit guide\r\n  pct.ratio = expected.error / tolerable.error\r\n  conf.factor = ceiling(MUS.factor(confidence.level, pct.ratio)*100)/100\r\n  ceiling(conf.factor / tolerable.error / book.value)\r\n}\r\n\r\nMUS.calc.n.conservative_VERSION_AFTER_CHANGE <- function(confidence.level, tolerable.error, expected.error, book.value) {\r\n  # calculate n consevatively, as per AICPA audit guide\r\n  pct.ratio = expected.error / tolerable.error\r\n  conf.factor = ceiling(MUS.factor(confidence.level, pct.ratio)*100)/100\r\n  ceiling(conf.factor / (tolerable.error / book.value)) ## Added brackets\r\n}\r\n\r\n\r\n\r\nconfidence.level <- 0.95\r\ntolerable.error <- 9 * 1000 * 1000\r\nexpected.error <- 3 * 1000 * 1000\r\nbook.value = 300 * 1000 * 1000`\r\n\r\n## 1. Version from package ####\r\nMUS.calc.n.conservative_VERSION_FROM_PACKAGE_CRAN_AND_GITHUB(confidence.level, tolerable.error, expected.error, book.value)\r\n# result = 1 (BAD)\r\nMUS::MUS.calc.n.conservative(confidence.level, tolerable.error, expected.error,book.value)\r\n# result = 1 (BAD)\r\n## 2. Version with updated brackets\r\nMUS.calc.n.conservative_VERSION_AFTER_CHANGE(confidence.level, tolerable.error, expected.error, book.value)\r\n# result = 220 (GOOD)\r\n```"},"comment":{"url":"https://api.github.com/repos/cran/MUS/issues/comments/432569303","html_url":"https://github.com/cran/MUS/pull/1#issuecomment-432569303","issue_url":"https://api.github.com/repos/cran/MUS/issues/1","id":432569303,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjU2OTMwMw==","user":{"login":"gaborcsardi","id":660288,"node_id":"MDQ6VXNlcjY2MDI4OA==","avatar_url":"https://avatars3.githubusercontent.com/u/660288?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborcsardi","html_url":"https://github.com/gaborcsardi","followers_url":"https://api.github.com/users/gaborcsardi/followers","following_url":"https://api.github.com/users/gaborcsardi/following{/other_user}","gists_url":"https://api.github.com/users/gaborcsardi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborcsardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborcsardi/subscriptions","organizations_url":"https://api.github.com/users/gaborcsardi/orgs","repos_url":"https://api.github.com/users/gaborcsardi/repos","events_url":"https://api.github.com/users/gaborcsardi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborcsardi/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T08:47:52Z","updated_at":"2018-10-24T08:47:52Z","author_association":"NONE","body":"@kiwimic That's because they forked that repository from here. That is somewhat unfortunate, and does not seem like a good idea."}}
{"actor":{"display_login":"gaborcsardi"}}