Hi R user, I am wondering whether I can perform a simple ANOVA analysis in the data in which I ?have mean + SE (+- Standard Error) for several groups.? For this one, ?I calculated upper and lower confidence interval and made three classes for each group (mean, upper and lower values). After that, I did ANOVA (simple Anova). I am wondering whether this is a wrong approach? ?I have given an example library(reshape) B<-structure(list(mean = c(0.0241262, 0.0433538, 0.2204764, 0.7830054 ), SE = c(0.0209097, 0.0329281, 0.1003248, 0.3019256), site = structure(1:4, .Label = c("A",? "B", "C", "D"), class = "factor")), .Names = c("mean", "SE",? "site"), class = "data.frame", row.names = c(NA, -4L)) attach(B) B1<-data.frame(B, Upper=mean+1.96*SE, Lower=mean-1.96*SE) B2<-subset(B1, select=c(-2)) B2 B3<-melt(B2, id=c("site")) B3 Anova<-aov(B3$value~B3$site) summary(Anova) Thanks?
This is a statistical question primarily and, as such, is off topic here. Either consult a local statistical expert or post to a statistical site like stats.stackexchange.com . Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Fri, Dec 26, 2014 at 6:38 AM, Kristi Glover <kristi.glover at hotmail.com> wrote:> Hi R user, > I am wondering whether I can perform a simple ANOVA analysis in the data in which I have mean + SE (+- Standard Error) for several groups. > For this one, I calculated upper and lower confidence interval and made three classes for each group (mean, upper and lower values). After that, I did ANOVA (simple Anova). I am wondering whether this is a wrong approach? I have given an example > > > library(reshape) > B<-structure(list(mean = c(0.0241262, 0.0433538, 0.2204764, 0.7830054 > ), SE = c(0.0209097, 0.0329281, 0.1003248, 0.3019256), site = structure(1:4, .Label = c("A", > "B", "C", "D"), class = "factor")), .Names = c("mean", "SE", > "site"), class = "data.frame", row.names = c(NA, -4L)) > attach(B) > B1<-data.frame(B, Upper=mean+1.96*SE, Lower=mean-1.96*SE) > B2<-subset(B1, select=c(-2)) > B2 > B3<-melt(B2, id=c("site")) > B3 > Anova<-aov(B3$value~B3$site) > summary(Anova) > > Thanks > > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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 could at least say that no, that is patently wrong! There are ways to reconstruct an ANOVA from means, sd, and group sizes, but this isn't it. In fact, the group sizes are not even used in the code. I agree about the need for a statistical expert. Fundamental misunderstandings seem to be present. -pd> On 26 Dec 2014, at 16:23 , Bert Gunter <gunter.berton at gene.com> wrote: > > This is a statistical question primarily and, as such, is off topic > here. Either consult a local statistical expert or post to a > statistical site like stats.stackexchange.com . > > Cheers, > Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > Clifford Stoll > > > > > On Fri, Dec 26, 2014 at 6:38 AM, Kristi Glover > <kristi.glover at hotmail.com> wrote: >> Hi R user, >> I am wondering whether I can perform a simple ANOVA analysis in the data in which I have mean + SE (+- Standard Error) for several groups. >> For this one, I calculated upper and lower confidence interval and made three classes for each group (mean, upper and lower values). After that, I did ANOVA (simple Anova). I am wondering whether this is a wrong approach? I have given an example >> >> >> library(reshape) >> B<-structure(list(mean = c(0.0241262, 0.0433538, 0.2204764, 0.7830054 >> ), SE = c(0.0209097, 0.0329281, 0.1003248, 0.3019256), site = structure(1:4, .Label = c("A", >> "B", "C", "D"), class = "factor")), .Names = c("mean", "SE", >> "site"), class = "data.frame", row.names = c(NA, -4L)) >> attach(B) >> B1<-data.frame(B, Upper=mean+1.96*SE, Lower=mean-1.96*SE) >> B2<-subset(B1, select=c(-2)) >> B2 >> B3<-melt(B2, id=c("site")) >> B3 >> Anova<-aov(B3$value~B3$site) >> summary(Anova) >> >> Thanks >> >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Kristi, The easiest way to do what you are looking for is the aovSufficient function in the HH package. ## install.packages("HH") ## if you don't have it yet library(HH) B.aov <- aovSufficient(mean ~ site, data=B, sd=B$SE, weights=c(3,3,3,3)) summary(B.aov) You must have the sample size for each of the groups. Your example did not include sample sizes, so there is no justification for the degrees of freedom in the residual. I invented sizes of 3 observations per group. See the pulmonary example in ?aovSufficient for a complete example. There are several style issues that need to be commented on. It is usually a bad idea to attach a data.frame. In this example, you attached B and then never used it, and also never detached it. That has the potential to mask objects farther down the search() list. When you use aov(), or any other function that takes a data= argument, it is best to use the data= argument. Rich On Fri, Dec 26, 2014 at 9:38 AM, Kristi Glover <kristi.glover at hotmail.com> wrote:> Hi R user, > I am wondering whether I can perform a simple ANOVA analysis in the data in which I have mean + SE (+- Standard Error) for several groups. > For this one, I calculated upper and lower confidence interval and made three classes for each group (mean, upper and lower values). After that, I did ANOVA (simple Anova). I am wondering whether this is a wrong approach? I have given an example > > > library(reshape) > B<-structure(list(mean = c(0.0241262, 0.0433538, 0.2204764, 0.7830054 > ), SE = c(0.0209097, 0.0329281, 0.1003248, 0.3019256), site = structure(1:4, .Label = c("A", > "B", "C", "D"), class = "factor")), .Names = c("mean", "SE", > "site"), class = "data.frame", row.names = c(NA, -4L)) > attach(B) > B1<-data.frame(B, Upper=mean+1.96*SE, Lower=mean-1.96*SE) > B2<-subset(B1, select=c(-2)) > B2 > B3<-melt(B2, id=c("site")) > B3 > Anova<-aov(B3$value~B3$site) > summary(Anova) > > Thanks > > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
> On 27 Dec 2014, at 02:50 , Richard M. Heiberger <rmh at temple.edu> wrote: > > Kristi, > > The easiest way to do what you are looking for is the aovSufficient function > in the HH package. > > ## install.packages("HH") ## if you don't have it yet > library(HH) > B.aov <- aovSufficient(mean ~ site, data=B, sd=B$SE, weights=c(3,3,3,3)) > summary(B.aov) >Ummm, you want SD, not SE, in there, don't you? -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com