6
$\begingroup$

I want to statistically compare the mean values from eight different groups. I do not have the raw data, but have the sample size, mean and associated standard deviation and standard error. I was wondering if there was any code in R to do the ANOVA test on summary data, as well as the subsequent post-hoc, pair-wise comparisons.

n <- c(796, 95, 245, 1645, 701, 1157, 211, 144)
means <- c(648, 680, 569, 602, 594, 596, 606, 623)
sd <- c(146.3, 90.5, 61.2, 98.9, 113.6, 106.8, 87.8, 76.9)

# Assigning the standard deviation and the sample size for each sample 
s.x <- 146.3
n.x <- 796
s.y <- 90.5
n.y <- 95
# Conducting the t-test with summary statistics
PASWR2::tsum.test(mean(648), s.x, n.x, mean(680), s.y, n.y) 
$\endgroup$
6
  • 2
    $\begingroup$ This post points to the rpsychi package, which does at least some of what you want, with the ind.oneway.second function for the ANOVA. $\endgroup$
    – Glen_b
    Commented May 1, 2014 at 17:08
  • $\begingroup$ Thanks for the help @Glen_b, I found the package 'BSDA' that has code to perform a t-test with the summary data. I am most interested in the pairwise comparisons between the means of all 8 groups, therefore, I am doing the 23 t-tests and using a Bonferroni correction (alpha/n) to adjust the p-value. Does this seem appropriate? $\endgroup$
    – user44690
    Commented May 1, 2014 at 19:05
  • $\begingroup$ I edited my original post to include the code that I am using to perform the multiple t-tests. $\endgroup$
    – user44690
    Commented May 1, 2014 at 19:14
  • 1
    $\begingroup$ This is not 'the' answer, however check the website statpages.info/anova1sm.html. $\endgroup$ Commented Feb 18, 2018 at 16:29
  • $\begingroup$ @MuthuPalani, that's a really neat tool, thanks a lot for providing the link! Does the tool on the page you provide do a Welch-t-test? It's hard to see from the description on the page $\endgroup$
    – P.Weyh
    Commented Oct 5, 2021 at 6:59

0

Browse other questions tagged or ask your own question.