N**B 发帖数: 1190 | 1 假设从一个bionomial distribution抽了50个samples, 要是结果全是0,则么算p的
confidence interval?记得有这样的文章讨论过,哪位大牛给给名字或者文章?大包子
酬谢! |
|
c*******e 发帖数: 5818 | 2 我这个肯定不对,5/0.4 是对的,但应该是bionomial |
|
d****n 发帖数: 1637 | 3 /*only works for small number */
/*die when integer overflow*/
#include
#include
int bico(int n, int k){
int t, i ,c ;
if (k>n) t=n, n=k, k=t;
if (k<0 ) return 0 ;
if (k>(n-k)) k=n-k;
c=1;
for(i=0;i
c*=(n-(k-(i+1))) , c/=(i+1);
return c ;
}
int main(int argc, char * argv[] ){
if(argc!=3) return -1;
int c;
c=bico(atoi(argv[1]) , atoi(argv[2]) ) ;
printf("bionomial %d\n", c);
} |
|
d****n 发帖数: 1637 | 4 /*working with larger numbers but still die */
/**C(80, 20) is okay, which was not ok in previous version**/
#include
#include
#include
float
gammln (float xx)
//Returns the value ln[Ãxx)] for xx > 0.
{
//Internal arithmetic will be done in double precision, a nicety that
//you can omit if five-figure
//accuracy is good enough.
double x, y, tmp, ser;
static double cof[6] = { 76.18009172947146, -86.50532032941677,
24.01409824083091, -1.231739572450155,
... 阅读全帖 |
|
d****n 发帖数: 1637 | 5 /*only works for small number */
/*die when integer overflow*/
#include
#include
int bico(int n, int k){
int t, i ,c ;
if (k>n) t=n, n=k, k=t;
if (k<0 ) return 0 ;
if (k>(n-k)) k=n-k;
c=1;
for(i=0;i
c*=(n-(k-(i+1))) , c/=(i+1);
return c ;
}
int main(int argc, char * argv[] ){
if(argc!=3) return -1;
int c;
c=bico(atoi(argv[1]) , atoi(argv[2]) ) ;
printf("bionomial %d\n", c);
} |
|
d****n 发帖数: 1637 | 6 /*working with larger numbers but still die */
/**C(80, 20) is okay, which was not ok in previous version**/
#include
#include
#include
float
gammln (float xx)
//Returns the value ln[Ãxx)] for xx > 0.
{
//Internal arithmetic will be done in double precision, a nicety that
//you can omit if five-figure
//accuracy is good enough.
double x, y, tmp, ser;
static double cof[6] = { 76.18009172947146, -86.50532032941677,
24.01409824083091, -1.231739572450155,
... 阅读全帖 |
|
c*********t 发帖数: 340 | 7 你可以去读一些small sample inference的东西,一般来说Exact method的确是
conservative, 因为bionomial分布是discrete的,所以才会有mid p value这种东东。
fisher exact的经典适用情况就是有任何一个cell小于5 |
|
|
|
D******n 发帖数: 2836 | 10 网上自己搜,一大堆。都是很纠结的。如果用Bayesian角度,就很简单直接。 |
|
s*r 发帖数: 2757 | 11 这个到是boostrap没发弄.大师可以拿来作为证据了 |
|
n*****n 发帖数: 3123 | 12 (1-p)^(-r)做泰勒展开
注意要用到generalized bionomial coefficients
包子please |
|
Y******Y 发帖数: 8753 | 13 i think you can consider modeling the data using either zero-inflated
poisson or zero-inflated negative bionomial (which is an alternative of
poisson that can account for overdispersion)
site
NORMDIST( |
|