简体   繁体   English

使用rpsychi(R)和随后的事后成对比较来进行单向方差分析

[英]Perfom a one-way ANOVA using rpsychi (R) and the subsequent post-hoc pair-wise comparisons

I have 4 samples, represented by their means and standard deviations. 我有4个样本,以均值和标准差表示。 If I consider a sample size for all of them as 100, how can I perform a one-way ANOVA using the library of rpsychi in R? 如果我将所有样本的样本量都视为100,如何使用R中的rpsychi库执行单向方差分析?

The samples are all normal distributed and independent. 这些样本都是正态分布的且独立的。

These are their values: 这些是它们的值:

S1: mean1=5.5, sd1=0.6 S1:平均值1 = 5.5,标准差1 = 0.6

S2: mean2=5.6, sd2=0.5 S2:平均值2 = 5.6,标准差2 = 0.5

S3: mean3=5.9, sd3=0.5 S3:mean3 = 5.9,sd3 = 0.5

S4: mean4=6.1, sd4=0.6 S4:mean4 = 6.1,sd4 = 0.6

How can I perform subsequently the post-hoc pair wise comparison (Tukey-HSD) using R as well?? 随后,我又如何使用R执行事后成对比较(Tukey-HSD)?

I have recently discover a post in other forum with some of my own concerns: http://www.wenda.io/questions/2570717/anova-in-r-using-summary-data.html 我最近在其他论坛上发现了一个我自己担心的帖子: http : //www.wenda.io/questions/2570717/anova-in-r-using-summary-data.html

It solved partially what I needed. 它部分解决了我所需要的。 Applying the code published in that web to my data: 将在该网站上发布的代码应用于我的数据:

mean <- c(5.5,5.6,5.9,6.1)
sd <- c(0.6,0.5,0.5,0.6)
n <- c(100,100,100,100)
q2data.frame <- data.frame(mean,sd,n)
library(rpsychi)
with(q2data.frame, ind.oneway.second(mean,sd,n))

I get the next ANOVA table: 我得到下一个方差分析表:

$anova.table
                SS  df    MS      F
Between (A)  22.75   3 7.583 24.863
Within      120.78 396 0.305       
Total       143.53 399             

$omnibus.es
      etasq etasq.lower etasq.upper 
      0.159       0.094       0.219 

$raw.contrasts
    mean.diff  lower  upper   std
1-2      -0.1 -0.254  0.054 0.078
1-3      -0.4 -0.554 -0.246 0.078
1-4      -0.6 -0.754 -0.446 0.078
2-3      -0.3 -0.454 -0.146 0.078
2-4      -0.5 -0.654 -0.346 0.078
3-4      -0.2 -0.354 -0.046 0.078

$standardized.contrasts
        es  lower  upper   std
1-2 -0.181 -0.459  0.097 0.141
1-3 -0.724 -1.002 -0.446 0.141
1-4 -1.086 -1.364 -0.808 0.141
2-3 -0.543 -0.821 -0.265 0.141
2-4 -0.905 -1.183 -0.627 0.141
3-4 -0.362 -0.640 -0.084 0.141

$power
 small medium  large 
 0.363  0.993  1.000

Does anybody know how can I get the p-value of the ANOVA analysis? 有人知道如何获得方差分析的p值吗? Moreover, how can I perform a TukeyHSD? 此外,如何执行TukeyHSD?

Use library(asbio). 使用库(asbio)。 This will give you t(s), mean differences, upper and lower bounds, HLSD Diff Lower Upper Decision Adj. 这将为您提供t(s),均值差,上限和下限,HLSD差异下限决策上限。 p-value decision, and adjusted p-value. p值决策和调整后的p值。

 #pairwise comparisons
 library(asbio)
 bonf <- pairw.anova(data$dv, data$group, method="tukey") #also try "bonf" or "lsd"
 print(tukey)
 #plot(tukey) #can plot the CFs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM