Alma Wilflinger
2013-Dec-05 21:05 UTC
[R] How do I print predicted effect sizes in forest plot?
Hi, I am struggling a bit with creating a forest plot containing the predicted effect size. As seen in other studies these effect sizes are shown per study usually as a light grey diamond - which is what I want to achieve. The calls I use are: iat_result = rma(yi=Mean, vi=Variance_rounded, ni=N, sei=Std_error, slab=Study_Name, subset=(Country == "AUT"), data=cma_iat, method="HS") summary.rma(iat_result) #not sure how to use it or if needed #predict(iat_result) forest(iat_result) At the end I am getting the forest plot as is without the predicted values. I am not sure if I need the predict function and how to use it? - the predict function deliveres the same values as already computed in the rma object. I checked the manual for package metafor but was not able to find out how to print the predicted values per study. kind regards, Alma [[alternative HTML version deleted]]
Viechtbauer Wolfgang (STAT)
2013-Dec-06 10:43 UTC
[R] How do I print predicted effect sizes in forest plot?
The model you are fitting is a random-effects model and does not include any potential moderators/covariates. Therefore, the estimated intercept of that model is *the* estimated/predicted (average) effect and it applies to each study. That is why the predict function also just gives you that value. That value is also included in the forest plot (at the bottom). The predicted (average) effect will no longer be the same for each study only if you include covariates in the model. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Psychology School for Mental Health and Neuroscience Faculty of Health, Medicine, and Life Sciences Maastricht University, P.O. Box 616 (VIJV1) 6200 MD Maastricht, The Netherlands +31 (43) 388-4170 | http://www.wvbauer.com> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of Alma Wilflinger > Sent: Thursday, December 05, 2013 22:06 > To: R help <r-help at r-project.org> > Subject: [R] How do I print predicted effect sizes in forest plot? > > Hi, > > I am struggling a bit with creating a forest plot containing the predicted > effect size. As seen in other studies these effect sizes are shown per > study usually as a light grey diamond - which is what I want to achieve. > > The calls I use are: > iat_result = rma(yi=Mean, vi=Variance_rounded, ni=N, sei=Std_error, > slab=Study_Name, subset=(Country == "AUT"), data=cma_iat, method="HS") > > summary.rma(iat_result) > > > #not sure how to use it or if needed > #predict(iat_result) > > forest(iat_result) > > > At the end I am getting the forest plot as is without the predicted > values. > > I am not sure if I need the predict function and how to use it? - the > predict function deliveres the same values as already computed in the rma > object. > > > I checked the manual for package metafor but was not able to find out how > to print the predicted values per study. > > > kind regards, Alma > [[alternative HTML version deleted]]
Viechtbauer Wolfgang (STAT)
2013-Dec-06 11:00 UTC
[R] How do I print predicted effect sizes in forest plot?
One more thing ... You used the command: iat_result = rma(yi=Mean, vi=Variance_rounded, ni=N, sei=Std_error, slab=Study_Name, subset=(Country == "AUT"), data=cma_iat, method="HS") This probably does not do what you want it to do. First of all, if you specify vi, there is no need to specify sei (or vice-versa). One is sufficient. But more crucially, I assume 'Mean' is what it says it is - a mean of a certain variable X. And I assume that 'Variance_rounded' is the variance of said variable X. But vi is used to specify the *sampling variance* of yi (or sei is used to specify the standard error), which, for a mean, is the variance divided by N (and the standard error is the SD divided by the square root of N): http://en.wikipedia.org/wiki/Standard_error_of_the_mean#Standard_error_of_the_mean So, my hunch is that you are not supplying the right information to the rma() function. Best, Wolfgang> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of Alma Wilflinger > Sent: Thursday, December 05, 2013 22:06 > To: R help <r-help at r-project.org> > Subject: [R] How do I print predicted effect sizes in forest plot? > > Hi, > > I am struggling a bit with creating a forest plot containing the predicted > effect size. As seen in other studies these effect sizes are shown per > study usually as a light grey diamond - which is what I want to achieve. > > The calls I use are: > iat_result = rma(yi=Mean, vi=Variance_rounded, ni=N, sei=Std_error, > slab=Study_Name, subset=(Country == "AUT"), data=cma_iat, method="HS") > > summary.rma(iat_result) > > > #not sure how to use it or if needed > #predict(iat_result) > > forest(iat_result) > > > At the end I am getting the forest plot as is without the predicted > values. > > I am not sure if I need the predict function and how to use it? - the > predict function deliveres the same values as already computed in the rma > object. > > > I checked the manual for package metafor but was not able to find out how > to print the predicted values per study. > > > kind regards, Alma > [[alternative HTML version deleted]]
Michael Dewey
2013-Dec-06 14:10 UTC
[R] How do I print predicted effect sizes in forest plot?
At 21:05 05/12/2013, Alma Wilflinger wrote:>Hi, > >I am struggling a bit with creating a forest plot containing the >predicted effect size. As seen in other studies these effect sizes >are shown per study usually as a light grey diamond - which is what >I want to achieve. > >The calls I use are: >iat_result = rma(yi=Mean, vi=Variance_rounded, ni=N, sei=Std_error, >slab=Study_Name, subset=(Country == "AUT"), data=cma_iat, method="HS")Alma You do not need to specify both vi and sei as one is sufficient and you do not need ni as well. I realise that is not the question you asked (which Wolfgang has already answered).>summary.rma(iat_result) > > >#not sure how to use it or if needed >#predict(iat_result) > >forest(iat_result) > > >At the end I am getting the forest plot as is without the predicted values. > >I am not sure if I need the predict function and how to use it? - >the predict function deliveres the same values as already computed >in the rma object. > > >I checked the manual for package metafor but was not able to find >out how to print the predicted values per study. > > >kind regards, Alma > [[alternative HTML version deleted]]Michael Dewey info at aghmed.fsnet.co.uk http://www.aghmed.fsnet.co.uk/home.html