简体   繁体   中英

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. 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?

The samples are all normal distributed and independent.

These are their values:

S1: mean1=5.5, sd1=0.6

S2: mean2=5.6, sd2=0.5

S3: mean3=5.9, sd3=0.5

S4: mean4=6.1, sd4=0.6

How can I perform subsequently the post-hoc pair wise comparison (Tukey-HSD) using R as well??

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

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? Moreover, how can I perform a TukeyHSD?

Use library(asbio). This will give you t(s), mean differences, upper and lower bounds, HLSD Diff Lower Upper Decision Adj. p-value decision, and adjusted p-value.

 #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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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