Skip to content

[R-meta] Peters test in metafor

5 messages · Phil Jones, James Pustejovsky, Viechtbauer Wolfgang (STAT) +1 more

#
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)
#
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:

            

  
  
#
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:

            
#
Thank you both.

I hope that you do not mind follow-up questions so that I can implement
this correctly.

In regard to: with(data, regtest(logrr, sei=sei, ni=ni, model="lm",
predictor="ninv"))

1. Is it acceptable if studies are a mixture of case-control and cohort
studies? (I know it is acceptable for meta-analysis generally, but is it OK
for Peters given the fact sample size is used for weighting and there are
such large differences in sample sizes of case-control cf. cohort studies?)

2. By total sample size, what does this mean in the context of categorical
exposures? For example, for an RR of a disease for highest vs lowest tea
consumption, is the total sample size the number of participants in the
highest and lowest categories only (i.e. excluding participants in the
medium categories between highest and lowest)?

3. Is there any (simple) way to use person years where sample size is not
available?

Thank you so much

On Fri, Jul 14, 2017 at 6:06 PM, Viechtbauer Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:

            

  
  
#
Dear Phil

If you have very different sample sizes then you will presumably have 
very different precisions as well so any sort of funnel plot/regression 
test will suffer from having one group of studies well separated from 
the other. In such circumstances I would be quite sceptical about any 
attempt to look for small study effects.

Michael
On 15/07/2017 10:18, Phil Jones wrote: