ANOVA in R using summary data
Is it possible to run ANOVA in r with just means, standard deviation and n-value? Here is my dataframe:
q2data.mean <- c(90,85,92,100,102,106)
q2data.sd <- c(9.035613,11.479667,9.760268,7.662572,9.830258,9.111457)
q2data.n <- c(9,9,9,9,9,9)
q2data.frame <- data.frame(q2data.mean,q2data.sq,q2data.n)
I'm trying to find an unnecessary tool square, so I want to take a look at the ANOVA table.
Any help would be really appreciated! :)
source to share
Here you go using ind.oneway.second
from the package rspychi
:
library(rpsychi)
with(q2data.frame, ind.oneway.second(q2data.mean,q2data.sd,q2data.n) )
#$anova.table
# SS df MS F
#Between (A) 2923.5 5 584.70 6.413
#Within 4376.4 48 91.18
#Total 7299.9 53
# etc etc
As an unrelated side of the note, your data can do with some renaming. q2data.frame
is data.frame
, you don't need to put it in the header. Also, no need to specify q2data.mean
inside q2data.frame
- most likely mean
would be enough. It just means that you end up with complex code like:
q2data.frame$q2data.mean
if a:
q2$mean
will provide you with all the information you need.
source to share