{"action":"created","issue":{"url":"https://api.github.com/repos/cpearce/fishers_exact/issues/2","repository_url":"https://api.github.com/repos/cpearce/fishers_exact","labels_url":"https://api.github.com/repos/cpearce/fishers_exact/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cpearce/fishers_exact/issues/2/comments","events_url":"https://api.github.com/repos/cpearce/fishers_exact/issues/2/events","html_url":"https://github.com/cpearce/fishers_exact/issues/2","id":367444863,"node_id":"MDU6SXNzdWUzNjc0NDQ4NjM=","number":2,"title":"Wrong value returned from r_fishers_exact","user":{"login":"heathsc","id":3264375,"node_id":"MDQ6VXNlcjMyNjQzNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/3264375?v=4","gravatar_id":"","url":"https://api.github.com/users/heathsc","html_url":"https://github.com/heathsc","followers_url":"https://api.github.com/users/heathsc/followers","following_url":"https://api.github.com/users/heathsc/following{/other_user}","gists_url":"https://api.github.com/users/heathsc/gists{/gist_id}","starred_url":"https://api.github.com/users/heathsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heathsc/subscriptions","organizations_url":"https://api.github.com/users/heathsc/orgs","repos_url":"https://api.github.com/users/heathsc/repos","events_url":"https://api.github.com/users/heathsc/events{/privacy}","received_events_url":"https://api.github.com/users/heathsc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-06T10:31:02Z","updated_at":"2018-11-05T10:32:31Z","closed_at":"2018-11-05T10:32:31Z","author_association":"NONE","body":"Hello,\r\n\r\nr_fishers_exact() (in src/R/fexact.c) is not returning the right value from fexact().   Depending on the value of the tails parameter, r_fishers_exact() either returns pre or prt when the tails parameter is 1 or 2 respectively.   However, fexact() does not return the 1 tailed p-value.  It either returns pre (the two sided p-value or the probability of the observed table or a more extreme table) or prt (the probability of the observed table alone). This can be seen from the documentation for fexact().   r_fishers_exact(), therefore, should only return pre as the two-sided p-value, while the tails parameter is redundant and should be removed.  This can be verified using R.  Using the first test example [1, 9, 11, 3] we get the following from R for the two sided, less and greater alternative options:\r\n\r\n> fisher.test(m<-matrix(c(1,9,11,3),ncol=2),alternative=\"two.sided\")$p.value\r\n[1] 0.002759456\r\n> fisher.test(m<-matrix(c(1,9,11,3),ncol=2),alternative=\"less\")$p.value\r\n[1] 0.001379728\r\n> fisher.test(m<-matrix(c(1,9,11,3),ncol=2),alternative=\"greater\")$p.value\r\n[1] 0.9999663\r\n>\r\nIt can be seen that the two sided results, 0.002759456, corresponds with the value given by r_fishers_exact() for tails==1.\r\n\r\nOn another note, r_fishers_exact only allows for 2x2 tables whereas fexact() can handle larger tables (within memory limits).  Could this limit be documented or relaxed?\r\n\r\nThanks,\r\nSimon\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cpearce/fishers_exact/issues/comments/435827746","html_url":"https://github.com/cpearce/fishers_exact/issues/2#issuecomment-435827746","issue_url":"https://api.github.com/repos/cpearce/fishers_exact/issues/2","id":435827746,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTgyNzc0Ng==","user":{"login":"cpearce","id":97721,"node_id":"MDQ6VXNlcjk3NzIx","avatar_url":"https://avatars1.githubusercontent.com/u/97721?v=4","gravatar_id":"","url":"https://api.github.com/users/cpearce","html_url":"https://github.com/cpearce","followers_url":"https://api.github.com/users/cpearce/followers","following_url":"https://api.github.com/users/cpearce/following{/other_user}","gists_url":"https://api.github.com/users/cpearce/gists{/gist_id}","starred_url":"https://api.github.com/users/cpearce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpearce/subscriptions","organizations_url":"https://api.github.com/users/cpearce/orgs","repos_url":"https://api.github.com/users/cpearce/repos","events_url":"https://api.github.com/users/cpearce/events{/privacy}","received_events_url":"https://api.github.com/users/cpearce/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T10:32:31Z","updated_at":"2018-11-05T10:32:31Z","author_association":"OWNER","body":"Thanks again for filing this issue. I've published a new version of fishers_exact which reports less, greater and two tails pvalues, and verified the test statistics against those produced by scipy. I removed the R code, and ported some new code to Rust, so the crate's code is much simpler pure Rust now. The new code handles 2x2 tables only, and I've documented that."}}
{"actor":{"display_login":"cpearce"}}