Skip to content

[R-meta] Reproducing results using regtest in metafor

1 message · James Pustejovsky

#
Option 1 amounts to fitting the model

Y_i = b0 + b1 m.c_i + b2 se_i + e_i

with the assumption that Var(e_i) = sigma^2 v_i for unknown sigma^2.  It
can be fit using the nlme package using the following syntax (building off
of the previous code):

library(nlme)
gls_fit <- gls(yi ~ m.c + sqrt(vi), data = ma.dataset, weights = varFixed(~
vi))
summary(gls_fit)

I think the correct df would be 27 in this case.

With option 2, the residuals from the first stage have lost 2 degrees of
freedom (down to 28), and then they lose two more with the second stage fit
(because the intercept is re-estimated when it should be constrained to
zero).

James

On Fri, Aug 9, 2019 at 8:24 AM Sutton, Alex (Prof.) <ajs22 at leicester.ac.uk>
wrote: