Hi all, I have a very easy questions (I hope). I had measure a property of plants, growing in three different substrates (A, B and C). The rest of the conditions remained constant. There was very high variation on the results. I want to do address, whether there is any difference in the response (my measurement) from substrate to substrate? x<-c('A','A','A','A','A','B','B','B','B','B','C','C','C','C','C') # Substrate type y <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) # Results of the measurement MD<-data.frame(x,y) I wrote a linear model for this: summary(lm(y~x,data=MD)) This is the output: Call: lm(formula = y ~ x, data = MD) Residuals: Min 1Q Median 3Q Max -2.000e+00 -1.000e+00 5.551e-17 1.000e+00 2.000e+00 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.0000 0.7071 4.243 0.001142 ** xB 5.0000 1.0000 5.000 0.000309 *** xC 10.0000 1.0000 10.000 3.58e-07 *** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Residual standard error: 1.581 on 12 degrees of freedom Multiple R-squared: 0.8929, Adjusted R-squared: 0.875 F-statistic: 50 on 2 and 12 DF, p-value: 1.513e-06 I conclude that there is an effect of substrate type (x). NOW the questions : 1) Do the fact that the all p-values are significant means that all the groups are different from each other ? 2) Is there a (easy) way to plot, mean plus/minus 2*sd for each substrate type ? (with asterisks denoting significant differences ?) THANKS ! version platform x86_64-apple-darwin9.8.0 arch x86_64 os darwin9.8.0 system x86_64, darwin9.8.0 status major 2 minor 11.1 year 2010 month 05 day 31 svn rev 52157 language R version.string R version 2.11.1 (2010-05-31)
The response variable "y" does not make sense to me. What does it represent? Friedman.steve@gmail.com 517-648-6290 -----Original message----- From: Ubuntu Diego <ubuntu.diego@gmail.com> To: r-help@r-project.org Sent: Wed, Apr 13, 2011 00:12:07 GMT+00:00 Subject: [R] is this an ANOVA ? Hi all, I have a very easy questions (I hope). I had measure a property of plants, growing in three different substrates (A, B and C). The rest of the conditions remained constant. There was very high variation on the results. I want to do address, whether there is any difference in the response (my measurement) from substrate to substrate? x<-c('A','A','A','A','A','B','B','B','B','B','C','C','C','C','C') # Substrate type y <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) # Results of the measurement MD<-data.frame(x,y) I wrote a linear model for this: summary(lm(y~x,data=MD)) This is the output: Call: lm(formula = y ~ x, data = MD) Residuals: Min 1Q Median 3Q Max -2.000e+00 -1.000e+00 5.551e-17 1.000e+00 2.000e+00 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.0000 0.7071 4.243 0.001142 ** xB 5.0000 1.0000 5.000 0.000309 *** xC 10.0000 1.0000 10.000 3.58e-07 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.581 on 12 degrees of freedom Multiple R-squared: 0.8929, Adjusted R-squared: 0.875 F-statistic: 50 on 2 and 12 DF, p-value: 1.513e-06 I conclude that there is an effect of substrate type (x). NOW the questions : 1) Do the fact that the all p-values are significant means that all the groups are different from each other ? 2) Is there a (easy) way to plot, mean plus/minus 2*sd for each substrate type ? (with asterisks denoting significant differences ?) THANKS ! version platform x86_64-apple-darwin9.8.0 arch x86_64 os darwin9.8.0 system x86_64, darwin9.8.0 status major 2 minor 11.1 year 2010 month 05 day 31 svn rev 52157 language R version.string R version 2.11.1 (2010-05-31) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Ubuntu Diego > Sent: April-12-11 5:10 PM > To: r-help at r-project.org > Subject: [R] is this an ANOVA ? > > Hi all, > I have a very easy questions (I hope). I had measure a property of plants, growing in three > different substrates (A, B and C). The rest of the conditions remained constant. There was very high > variation on the results. > I want to do address, whether there is any difference in the response (my measurement) from > substrate to substrate? > > x<-c('A','A','A','A','A','B','B','B','B','B','C','C','C','C','C') # Substrate type > y <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) # Results of the measurement > MD<-data.frame(x,y) > > I wrote a linear model for this: > > summary(lm(y~x,data=MD)) > > This is the output: > > Call: > lm(formula = y ~ x, data = MD) > > Residuals: > Min 1Q Median 3Q Max > -2.000e+00 -1.000e+00 5.551e-17 1.000e+00 2.000e+00 > > Coefficients: > Estimate Std. Error t value Pr(>|t|) > (Intercept) 3.0000 0.7071 4.243 0.001142 ** > xB 5.0000 1.0000 5.000 0.000309 *** > xC 10.0000 1.0000 10.000 3.58e-07 *** > --- > Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > Residual standard error: 1.581 on 12 degrees of freedom > Multiple R-squared: 0.8929, Adjusted R-squared: 0.875 > F-statistic: 50 on 2 and 12 DF, p-value: 1.513e-06 > > I conclude that there is an effect of substrate type (x). > NOW the questions : > 1) Do the fact that the all p-values are significant means that all the groups are > different from each other ?No, the small p-values indicate that the associated estimate appears to be significantly different from zero. You can use the package "multcomp" to do multiple comparisons. > require("multcomp") > lma <- aov(y ~ x, data = MD) > lmamc <- glht(lma, linfct = mcp(x = "Tukey")) > ci.lma <- confint(lmamc) > ci.lma Simultaneous Confidence Intervals Multiple Comparisons of Means: Tukey Contrasts Fit: aov(formula = y ~ x, data = MD) Quantile = 2.667 95% family-wise confidence level Linear Hypotheses: Estimate lwr upr B - A == 0 5.0000 2.3330 7.6670 C - A == 0 10.0000 7.3330 12.6670 C - B == 0 5.0000 2.3330 7.6670 > lmacld <- cld(lmamc) > plot(lmacld) > plot(ci.lma)> 2) Is there a (easy) way to plot, mean plus/minus 2*sd for each substrate type ? (with > asterisks denoting significant differences ?)Not that I know of, though the multcomp tables and plots yield logically equivalent results and plots. Writing a few lines of code to accomplish your graph is fairly straightforward. HTH Steven McKinney> > > THANKS ! > > version > platform x86_64-apple-darwin9.8.0 > arch x86_64 > os darwin9.8.0 > system x86_64, darwin9.8.0 > status > major 2 > minor 11.1 > year 2010 > month 05 > day 31 > svn rev 52157 > language R > version.string R version 2.11.1 (2010-05-31) > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
You may try the following to perform anova: anova(lm(y~x)) or summary(aov(y~x)) 2011/4/13 Ubuntu Diego <ubuntu.diego@gmail.com>> Hi all, > I have a very easy questions (I hope). I had measure a property of > plants, growing in three different substrates (A, B and C). The rest of the > conditions remained constant. There was very high variation on the results. > I want to do address, whether there is any difference in the > response (my measurement) from substrate to substrate? > > x<-c('A','A','A','A','A','B','B','B','B','B','C','C','C','C','C') # > Substrate type > y <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) # Results of the measurement > MD<-data.frame(x,y) > > I wrote a linear model for this: > > summary(lm(y~x,data=MD)) > > This is the output: > > Call: > lm(formula = y ~ x, data = MD) > > Residuals: > Min 1Q Median 3Q Max > -2.000e+00 -1.000e+00 5.551e-17 1.000e+00 2.000e+00 > > Coefficients: > Estimate Std. Error t value Pr(>|t|) > (Intercept) 3.0000 0.7071 4.243 0.001142 ** > xB 5.0000 1.0000 5.000 0.000309 *** > xC 10.0000 1.0000 10.000 3.58e-07 *** > --- > Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > Residual standard error: 1.581 on 12 degrees of freedom > Multiple R-squared: 0.8929, Adjusted R-squared: 0.875 > F-statistic: 50 on 2 and 12 DF, p-value: 1.513e-06 > > I conclude that there is an effect of substrate type (x). > NOW the questions : > 1) Do the fact that the all p-values are significant means > that all the groups are different from each other ? > 2) Is there a (easy) way to plot, mean plus/minus 2*sd for > each substrate type ? (with asterisks denoting significant differences ?) > > > THANKS ! > > version > platform x86_64-apple-darwin9.8.0 > arch x86_64 > os darwin9.8.0 > system x86_64, darwin9.8.0 > status > major 2 > minor 11.1 > year 2010 > month 05 > day 31 > svn rev 52157 > language R > version.string R version 2.11.1 (2010-05-31) > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
You probably want to do something like this:> fm <- lm(y ~ x, MD) > anova(fm)Analysis of Variance Table Response: y Df Sum Sq Mean Sq F value Pr(>F) x 2 250 125.0 50 1.513e-06 Residuals 12 30 2.5 Answers to questions: 1. No. 2. Yes. (whoever you are). -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Ubuntu Diego Sent: Wednesday, 13 April 2011 10:10 AM To: r-help at r-project.org Subject: [R] is this an ANOVA ? Hi all, I have a very easy questions (I hope). I had measure a property of plants, growing in three different substrates (A, B and C). The rest of the conditions remained constant. There was very high variation on the results. I want to do address, whether there is any difference in the response (my measurement) from substrate to substrate? x<-c('A','A','A','A','A','B','B','B','B','B','C','C','C','C','C') # Substrate type y <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) # Results of the measurement MD<-data.frame(x,y) I wrote a linear model for this: summary(lm(y~x,data=MD)) This is the output: Call: lm(formula = y ~ x, data = MD) Residuals: Min 1Q Median 3Q Max -2.000e+00 -1.000e+00 5.551e-17 1.000e+00 2.000e+00 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.0000 0.7071 4.243 0.001142 ** xB 5.0000 1.0000 5.000 0.000309 *** xC 10.0000 1.0000 10.000 3.58e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.581 on 12 degrees of freedom Multiple R-squared: 0.8929, Adjusted R-squared: 0.875 F-statistic: 50 on 2 and 12 DF, p-value: 1.513e-06 I conclude that there is an effect of substrate type (x). NOW the questions : 1) Do the fact that the all p-values are significant means that all the groups are different from each other ? 2) Is there a (easy) way to plot, mean plus/minus 2*sd for each substrate type ? (with asterisks denoting significant differences ?) THANKS ! version platform x86_64-apple-darwin9.8.0 arch x86_64 os darwin9.8.0 system x86_64, darwin9.8.0 status major 2 minor 11.1 year 2010 month 05 day 31 svn rev 52157 language R version.string R version 2.11.1 (2010-05-31) ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Apparently Analagous Threads
- Indexing in anova summary output of the form: summary(aov(y ~ x1, Error = (x1/x2)))
- deSolve, extracting variable values from inside ode function
- summary of aov fit on a contrast basis
- Error occurring in "emmeans" package for the two data sets I used. Please help.
- 2x2 Contingency table with much sampling zeroes