- 程序有所改变。发帖如还有问题请报告
- 【征集】西西河的经济学,及清流措施,需要主动参与者,『稷下学宫』新认证方式,24年网站打算和努力目标
主题:求教一个统计问题,多谢 -- 无花
我是学生物的, 遇到一个问题, 不知道什么样的statistical test合适,希望大虾指
点一二。
用仍硬币做比方。
每个trial仍100次,记录多少次正面。
重复1000个trial,(每个trial会有不同的条件, 比如不同的人, 不同的房间等)。
这样就有1000个数据, 问用什么样的test可以判断这个硬币是不是fair?
多谢。
你这个是“产生随机数”的问题吧?就是说是“真随机数”还是“伪随机数”的问题吧。有专门文章讲这个东西的。
具体到仍硬币,1000个trial,可一用大数定理了。这个硬币如果是fair,在正、反面占百分比的坐标下,应该是以(0.5,0.5)为中值的正态分布?
为了比较100和1000次的分布?
说英文吧。术语熟一些。
It is related to a Monte Carlo simulation.
1. You calculate the number of heads for each trial, for 1000 times. Call the value y1 to y1000. You have a distribution of 1000 y values.
2. You calculate the average of these 1000 y values and call it X. X is the sample mean of your distribution.
3. According to the central limit theorem, X follows a normal distribution. You can use this distribution to test your hull which is 50 (a fair toss out of 100). The test stat is: z= (X-50)/s/sqrt(1000), where s is the variance of a binomial distribution of 100 tosses: s=100*(0.5)*(1-0.5)=25. Compare z with a standard normal distribution table, or a t-dist table. A rule of thumb is that in order to not reject the null, z should be smaller than 1.96.
Hope it helps.
你的问题抽象一下就是
假设第i次trial硬币是正面的概率是p+ai。p是真正的概率,ai是不同的人,不同的房间额外的影响。
假设ai~N(0,sigma^2)
每次trial,
xi|p,ai~Bin(p+ai,100)
使用Central Limit Theorem, 平均数xibar大致是正态分布。
xibar|p,ai~N(p+ai,(p+ai)(1-p-ai)/100)
那么
f(xibar,ai|p,sigma^2)=f(xibar|p,ai)g(ai|sigma^2)
(g(ai)是marginal distribution of ai)
对ai积分,你可以得到marginal distribution of xibar
根据这个你可以写出xibar的Likelihood Function,使用Maximum Likelihood估计p和sigma^2,然后套用各种aysmptotic tests就是了。
H0:p=0.5
Likelihood Ratio Test是说
2(L(p=0.5)-L(p=p_mle))大约是chi-square分布,自由度是1。