Hi all! I have 4 treatments on 5 animals Treat1 Treat2 Treat3 Treat4 Animal1 36 37 35 39 Animal2 33 34 36 37 Animal3 37 35 33 38 Animal4 34 36 34 35 Animal5 35 36 33 36 I use an Anova and i try to verify calcul So i retrieve: DF SS MS F P Between Groups 3 20.950 6.983 3.492 Residual 16 32.000 2.000 Total 19 52.950 2.787 How can i calcul the p-Value? Is there a function to do this? Laurent Houdusse Analyste Programmeur
One way is:> dat = read.table("clipboard", head=T, row=1) > datTreat1 Treat2 Treat3 Treat4 Animal1 36 37 35 39 Animal2 33 34 36 37 Animal3 37 35 33 38 Animal4 34 36 34 35 Animal5 35 36 33 36> y <- unlist(dat) > yTreat11 Treat12 Treat13 Treat14 Treat15 Treat21 Treat22 Treat23 Treat24 Treat25 36 33 37 34 35 37 34 35 36 36 Treat31 Treat32 Treat33 Treat34 Treat35 Treat41 Treat42 Treat43 Treat44 Treat45 35 36 33 34 33 39 37 38 35 36> trt = gl(4,5) > trt[1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 Levels: 1 2 3 4> summary(aov(y~trt))Df Sum Sq Mean Sq F value Pr(>F) trt 3 20.950 6.983 3.4917 0.04033 * Residuals 16 32.000 2.000 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 If you just want the p-value, given the ANOVA table, then you can do:> pf(3.492, 3, 16, lower.tail=FALSE)[1] 0.04032243 Andy> From: Laurent Houdusse > > Hi all! > > I have 4 treatments on 5 animals > Treat1 Treat2 Treat3 Treat4 > Animal1 36 37 35 39 > Animal2 33 34 36 37 > Animal3 37 35 33 38 > Animal4 34 36 34 35 > Animal5 35 36 33 36 > > I use an Anova and i try to verify calcul > So i retrieve: > DF SS MS F P > Between Groups 3 20.950 6.983 3.492 > Residual 16 32.000 2.000 > Total 19 52.950 2.787 > > How can i calcul the p-Value? Is there a function to do this? > > > Laurent Houdusse > Analyste Programmeur >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
Laurent Houdusse <l.houdusse at cerep.fr> writes:> Hi all! > > I have 4 treatments on 5 animals > Treat1 Treat2 Treat3 Treat4 > Animal1 36 37 35 39 > Animal2 33 34 36 37 > Animal3 37 35 33 38 > Animal4 34 36 34 35 > Animal5 35 36 33 36 > > I use an Anova and i try to verify calcul > So i retrieve: > DF SS MS F P > Between Groups 3 20.950 6.983 3.492 > Residual 16 32.000 2.000 > Total 19 52.950 2.787 > > How can i calcul the p-Value? Is there a function to do this?Yes:> 1-pf(3.492,3,16)[1] 0.04032243 However, this might not be the appropriate analysis if the animals are the same across treatments (not that it matters much in this case):> summary(aov(y ~ treat, data=dd))Df Sum Sq Mean Sq F value Pr(>F) treat 3 20.950 6.983 3.4917 0.04033 * Residuals 16 32.000 2.000 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1> summary(aov(y ~ treat+animal, data=dd))Df Sum Sq Mean Sq F value Pr(>F) treat 3 20.9500 6.9833 3.9343 0.03623 * animal 4 10.7000 2.6750 1.5070 0.26146 Residuals 12 21.3000 1.7750 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907