ttest__t检验及matlab简析


t-检验,又称student‘s t-test,可以用于比较两组数据是否来自同一分布(可以用于比较两组数据的区分度),假设了数据的正态性,并反应两组数据的方差在统计上是否有显著差异。

matlab中提供了两种相同形式的方法来解决这一假设检验问题,分别为ttest方法和ttest2方法,两者的参数、返回值类型均相同,不同之处在于ttest方法做的是 One-sample and paired-sample t-test,而ttest2则是 Two-sample t-test with pooled or unpooled variance estimate, performs an unpaired two-sample t-test。但是这里至于paired和unpaired之间的区别我却还没搞清楚,只是在Student's t-test中看到了如下这样一段解释:

“Two-sample t-tests for a difference in mean involve independent samples, paired samples and overlapping samples. Pairedt-tests are a form ofblocking, and have greater power than unpaired tests when the paired units are similar with respect to "noise factors" that are independent of membership in the two groups being compared.[8] In a different context, paired t-tests can be used to reduce the effects ofconfounding factors in anobservational study.”

因此粗略认为paired是考虑了噪声因素的。

在同样的两组数据上分别用ttest和ttest2方法得出的结果进行比较,发现ttest返回的参数p普遍更小,且置信区间ci也更小。


最常用用法:
[H,P,CI]=ttest2(x,y);(用法上ttest和ttest2相同,完整形式为[H,P,CI, STATS]=ttest2(x,y, ALPHA);)

其中,x,y均为行向量(维度必须相同),各表示一组数据,ALPHA为可选参数,表示设置一个值作为t检验执行的显著性水平(performs the test at the significance level
    (100*ALPHA)%),在不设置ALPHA的情况下默认ALPHA为0.05,即计算x和y在5%的显著性水平下是否来自同一分布(假设是否被接受)
结果:H=0,则表明零假设在5%的置信度下被拒绝(根据当设置x=y时候,返回的H=0推断而来),即x,y在统计上可看做来自同一分布的数据;H=1,表明零假设被拒绝,即x,y在统计上认为是来自不同分布的数据,即有区分度。

P为一个概率,matlab help中的解释是“ the p-value, i.e., the probability of observing the given result, or one more extreme, by chance if the null  hypothesis is true.  Small values of P cast doubt on the validity of  the null hypothesis.” 暂且认为表示判断值在真实分布中被观察到的概率(?不太懂)

CI为置信区间(confidence interval),表示“a 100*(1-ALPHA)% confidence interval for the true difference of population means”,即达到100*(1-ALPHA)%的置信度的数据区间(?)


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值