R:如何为单向ANOVA数据创建平均值,SD和n表

时间:2017-10-20 17:49:59

标签: r summary anova

为了弄清楚如何为执行单向ANOVA时使用的治疗组创建平均值,SD和n的信息汇总表,我一直在努力。

这就是我所拥有的:

首先,我将数据放入R。

    Group1 <- c(9,10,7,8,4)
    Group2 <- c(3,5,4,6,2)
    Group3 <- c(4,6,5,3,4)
    Group4 <- c(9,9,6,8,10)
    Group5 <- c(3,3,2,3,4)

    Combined_Groups<-data.frame(cbind(Group1,Group2,Group3,Group4,Group5))
    Combined_Groups #shows spreadsheet like results
    summary((Combined_Groups)) #min, median, mean, max

    Stacked_Groups <- stack(Combined_Groups)
    Stacked_Groups #shows the table Stacked_Groups

    Anova_Results<-aov(values~ind,data=Stacked_Groups)
    summary(Anova_Results) #shows Anova_Results

    qf (.95, df1=4, df2=20) #this gives you the critical mean of the F distribution

这是我遇到问题的地方。我尝试了各种方法来创建一个表,但它们都失败了。此外,由于某种原因,n()不被认为是获得每个治疗组的重复次数的函数。

获得每个治疗组的平均值,SD和n表的正确代码是什么?另外,如何将n()识别为每个治疗组获得重复次数的函数?

0 个答案:

没有答案