Morris, Kathryn
2016-Jul-29 13:44 UTC
[R] metafor estimates using mods and subset do not match
I am running a meta-analysis using metafor and getting what seem to be conflicting results. #analysis with species moderator cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, mods=~dataCropMeta$species - 1, method="HE") The output for the analysis using species as a moderator shows estimates for the seven species in my data set, and makes sense. #subset analysis with B oleraceae cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, subset=(species=="B. oleracea"), method="HE") Then when I start to plot the results and use separate analyses for each species in order to get the coef and variances for plotting the subgroups I get different estimates. The estimates for most subgroups are almost identical in both analyses, but one of them is 5.922 in the analysis with species as a moderator, and 7.0139 in the subset analysis for only that species. Why are the estimates different? If they should be different, then which analysis is producing the correct estimates? I'm happy to provide the data and R scripts if that would help. many thanks, Kathryn --------------------------------- Dr. Kathryn Morris Assistant Professor, Biology Xavier University 3800 Victory Parkway Cincinnati, OH 45207 Office: (513) 745-3554
Bert Gunter
2016-Jul-29 15:18 UTC
[R] metafor estimates using mods and subset do not match
I think you should consult with a local statistician. Generally speaking, statistical questions like this tend to be OT here, and you appear to be sufficiently confused about the statistical issues that online posts would not be sufficient. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jul 29, 2016 at 6:44 AM, Morris, Kathryn <morrisk10 at xavier.edu> wrote:> I am running a meta-analysis using metafor and getting what seem to be conflicting results. > > #analysis with species moderator > cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, mods=~dataCropMeta$species - 1, method="HE") > > The output for the analysis using species as a moderator shows estimates for the seven species in my data set, and makes sense. > > #subset analysis with B oleraceae > cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, subset=(species=="B. oleracea"), method="HE") > > Then when I start to plot the results and use separate analyses for each species in order to get the coef and variances for plotting the subgroups I get different estimates. The estimates for most subgroups are almost identical in both analyses, but one of them is 5.922 in the analysis with species as a moderator, and 7.0139 in the subset analysis for only that species. > > Why are the estimates different? If they should be different, then which analysis is producing the correct estimates? > > I'm happy to provide the data and R scripts if that would help. > > many thanks, > Kathryn > > > --------------------------------- > > Dr. Kathryn Morris > Assistant Professor, Biology > Xavier University > 3800 Victory Parkway > Cincinnati, OH > 45207 > > Office: (513) 745-3554 > > ______________________________________________ > 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.
Michael Dewey
2016-Jul-29 15:33 UTC
[R] metafor estimates using mods and subset do not match
Dear Kathryn I think that the author of metafor has addressed this http://www.metafor-project.org/doku.php/tips:comp_two_independent_estimates The other tips on that site are well worth reading too. On 29/07/2016 14:44, Morris, Kathryn wrote:> I am running a meta-analysis using metafor and getting what seem to be conflicting results. > > #analysis with species moderator > cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, mods=~dataCropMeta$species - 1, method="HE") > > The output for the analysis using species as a moderator shows estimates for the seven species in my data set, and makes sense. > > #subset analysis with B oleraceae > cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, subset=(species=="B. oleracea"), method="HE") > > Then when I start to plot the results and use separate analyses for each species in order to get the coef and variances for plotting the subgroups I get different estimates. The estimates for most subgroups are almost identical in both analyses, but one of them is 5.922 in the analysis with species as a moderator, and 7.0139 in the subset analysis for only that species. > > Why are the estimates different? If they should be different, then which analysis is producing the correct estimates? > > I'm happy to provide the data and R scripts if that would help. > > many thanks, > Kathryn > > > --------------------------------- > > Dr. Kathryn Morris > Assistant Professor, Biology > Xavier University > 3800 Victory Parkway > Cincinnati, OH > 45207 > > Office: (513) 745-3554 > > ______________________________________________ > 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. >-- Michael http://www.dewey.myzen.co.uk/home.html