美文网首页
t检验与方差分析的区别

t检验与方差分析的区别

作者: 柏金_cfa5 | 来源:发表于2019-03-31 18:27 被阅读0次

一、同:

1.原理:

自变量不同产生的差异/随机因素产生的差异,来检验这个自变量不同产生的差异是否足够大到,可以结论说这个自变量对因变量有显著影响。

2.检验显著性

t^2 = F

二、异:

t.test F.test
1.indication 2组的均值比较 2组及以上的比较
方差齐(组内差异相等) 组内差异&组间差异
小样本(n<30)
当比较方差齐的两组均值时,P(t.test)=P(F.test)
2. methods (组1均值-组2均值)/ 方差 求和(每组均值-总均值)/求和(每个值-组内均值)
1.独立样本T检验,2.配对样本T检验,3.单样本T检验 1.单因素(一组多变量),2.多因素

知乎大佬说

三、一个例子

当比较方差齐的两组时,P(t.test)=P(F.test) CSDN

#1.两组数据,方差齐
weight<-scan()
16.68 20.67 18.42 18 17.44 15.95 18.68 23.22 21.42 19 18.92 NA
V<-rep(c('LY1','DXY'),rep(6,2))
df<-data.frame(V,weight)
a<-subset(df$weight,V=='LY1')
b<-subset(df$weight,V=='DXY')

var.test(a,b) #检验是否方差齐
#p-value =0.6653,,接受H0,方差齐
#{

    F test to compare two variances

data:  a and b
F = 0.6729, num df = 5, denom df = 4, p-value =
0.6653
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.07185621 4.97127448
sample estimates:
ratio of variances 
         0.6728954 
         }


t.test(a,b,var.equal=T,paired = F)
#p-value = 0.0571
#{  Two Sample t-test

data:  a and b
t = -2.1808, df = 9, p-value = 0.0571
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -4.86513222  0.08913222
sample estimates:
mean of x mean of y 
   17.860    20.248 
}

fit<-aov(weight~V,data=df)
summary(fit)
#p-value = 0.0571
#t^2=(-2.1808)^2 = F=4.756
#{
                Df Sum Sq Mean Sq F value Pr(>F)  
V            1  15.55   15.55   4.756 0.0571 .
Residuals    9  29.43    3.27                 
---
Signif. codes:  
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
1 observation deleted due to missingness
}


#2.两组数据,方差不齐
weight<-scan()
16.68 20.67 18.42 18 17.44 30 18.68 23.22 21.42 19 18.92 82
V<-rep(c('LY1','DXY'),rep(6,2))
df<-data.frame(V,weight)
a<-subset(df$weight,V=='LY1')
b<-subset(df$weight,V=='DXY')

var.test(a,b) 
#p-value= 0.002832,方差不齐
#{
        F test to compare two variances

data:  a and b
F = 0.038913, num df = 5, denom df = 5, p-value
= 0.002832
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.005445095 0.278085194
sample estimates:
ratio of variances 
        0.03891273 
}

t.test(a,b,var.equal=T,paired = F)
#p-value = 0.3488
#{
    Two Sample t-test

data:  a and b
t = -0.98304, df = 10, p-value = 0.3488
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -33.77097  13.09431
sample estimates:
mean of x mean of y 
 20.20167  30.54000 
}

t.test(a,b,var.equal=F,paired = F) #Welch法,校正方差不齐
#p-value = 0.3676
#{
Welch Two Sample t-test

data:  a and b
t = -0.98304, df = 5.3885, p-value = 0.3676
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -36.79643  16.11976
sample estimates:
mean of x mean of y 
 20.20167  30.54000 
}

fit<-aov(weight~V,data=df)
summary(fit)
#p-value = 0.349
#{
                Df Sum Sq Mean Sq F value Pr(>F)
V            1    321   320.6   0.966  0.349
Residuals   10   3318   331.8      
}


相关文章

  • 《白话统计》读书笔记-t and anovar

    t检验t检验的使用条件t检验的实现独立样本t检验配对样本t检验Wilcoxon秩和的实现 方差分析方差分析中变异分...

  • t检验与方差分析的区别

    一、同: 1.原理: 自变量不同产生的差异/随机因素产生的差异,来检验这个自变量不同产生的差异是否足够大到,可以结...

  • 统计检验

    参数检验和非参数检验的区别: 期刊文献中常规数据的主流统计检验方法分为两种:以T检验、方差分析等为代表的参...

  • SPSS统计分析

    参数检验 SPSS——独立样本T检验 SPSS——配对样本T检验 SPSS——单因素方差分析 非参数检验 SPSS...

  • 第二天:SPSS-方差分析

    方差分析 如果要检验两个总体的均值是否相等,我们可以用t检验。 当要检验多个总体的均值是否相等,则需要采用方差分析...

  • 非参检验

    总览 参数检验非参检验工具t检验、方差分析卡方检验、中位数检验特点正态分布、定距非正态、定类、定序 卡方检验是与期...

  • 25高通量测序-线性模拟之t检验与单因素方差分析

    线性模拟之t检验与单因素方差分析 t-test ​ 快速回顾线性回归,我们测量了老鼠的重量和大小,我们...

  • 参数检验和非参数检验简介

    在统计分析中分析中经常遇到某种检验方法为参数检验或非参数检验,例如T检验、Tukey检验、方差分析都属于参数检验,...

  • 精通统计学,R,Stata ,Eviews ,SPSS,企鹅:4

    精通统计图表的制作、描述性统计、正态性检验、t检验,卡方检验、秩和检验、方差分析、相关分析、典型相关分析、回归分析...

  • 大数据统计基础之F分布及其应用

    大数据统计基础之F分布及其应用 1. F分布1.1. Z检验和t检验的局限性1.2. 方差分析的含义与假设1.3....

网友评论

      本文标题:t检验与方差分析的区别

      本文链接:https://www.haomeiwen.com/subject/iwuubqtx.html