[R-meta] Peters test in metafor
Viechtbauer Wolfgang (SP)
wolfgang.viechtbauer at maastrichtuniversity.nl
Fri Jul 14 19:06:47 CEST 2017
To clarify the last point - you have two options:
1) Fit the model with:
res <- rma(logrr, sei=sei, ni=ni, method="DL", data=data)
assuming that 'ni' is the name of the variable in 'data' that contains the total sample size of each study. Then you can do:
regtest(res, model="lm", predictor="ninv")
2) Or just do:
with(data, regtest(logrr, sei=sei, ni=ni, model="lm", predictor="ninv"))
Both will give you the same result.
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of James Pustejovsky
Sent: Friday, July 14, 2017 18:52
To: Phil Jones
Cc: r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] Peters test in metafor
Use regtest() with model = "lm" and predictor = "ninv." Note that you'll
need to provide the total sample sizes too.
On Fri, Jul 14, 2017 at 9:26 AM, Phil Jones <philpauljones at gmail.com> wrote:
> I would like to use Peters test to assess publication bias in a
> meta-analysis. My code for the main analysis is below. What syntax do I use
> to perform Peters and how do I know if the result is significant
> (presumably a p-value is returned)?
>
> Thanks
>
> res<-rma(yi=logrr,sei = sei,method="DL",data=data)
More information about the R-sig-meta-analysis
mailing list