# The metafor Package

A Meta-Analysis Package for R

### Site Tools

analyses:vanhouwelingen2002

# Differences

This shows you the differences between two versions of the page.

 analyses:vanhouwelingen2002 [2021/10/22 14:46]Wolfgang Viechtbauer analyses:vanhouwelingen2002 [2021/10/22 15:29]Wolfgang Viechtbauer Both sides previous revision Previous revision 2021/11/08 15:13 Wolfgang Viechtbauer 2021/10/22 15:29 Wolfgang Viechtbauer 2021/10/22 14:46 Wolfgang Viechtbauer 2021/05/09 15:39 Wolfgang Viechtbauer 2021/05/09 15:38 Wolfgang Viechtbauer 2021/05/09 15:38 Wolfgang Viechtbauer 2021/05/09 15:37 Wolfgang Viechtbauer 2021/05/09 15:37 Wolfgang Viechtbauer 2021/05/09 15:36 Wolfgang Viechtbauer 2021/05/09 15:33 Wolfgang Viechtbauer 2020/12/14 10:58 Wolfgang Viechtbauer 2020/06/26 07:01 Wolfgang Viechtbauer 2020/06/26 06:45 Wolfgang Viechtbauer 2020/03/19 13:47 Wolfgang Viechtbauer 2018/12/08 13:16 external edit 2021/11/08 15:13 Wolfgang Viechtbauer 2021/10/22 15:29 Wolfgang Viechtbauer 2021/10/22 14:46 Wolfgang Viechtbauer 2021/05/09 15:39 Wolfgang Viechtbauer 2021/05/09 15:38 Wolfgang Viechtbauer 2021/05/09 15:38 Wolfgang Viechtbauer 2021/05/09 15:37 Wolfgang Viechtbauer 2021/05/09 15:37 Wolfgang Viechtbauer 2021/05/09 15:36 Wolfgang Viechtbauer 2021/05/09 15:33 Wolfgang Viechtbauer 2020/12/14 10:58 Wolfgang Viechtbauer 2020/06/26 07:01 Wolfgang Viechtbauer 2020/06/26 06:45 Wolfgang Viechtbauer 2020/03/19 13:47 Wolfgang Viechtbauer 2018/12/08 13:16 external edit Last revision Both sides next revision Line 315: Line 315: abline(h=x) abline(h=x) + + While the coefficient (i.e., 0.7300) of the relationship between the underlying true log odds in the vaccinated and unvaccinated groups obtained above is correct, the computation of the corresponding standard error is not quite right, as it assumes that the variance-covariance matrix used as input to ''matreg()'' (i.e., ''res$G'') was obtained from 'raw data' for ''res$g.levels.comb.k'' (i.e., 13) paired data points, when in fact ''res$G'' is the estimated variance-covariance matrix of the random effects from the bivariate model. To obtain a more appropriate standard error, we need to first obtain the variance-covariance matrix of the estimates in ''res$G'', which we can get with:((By default, there are numerical problems inverting the Hessian matrix in this example, which we can work around using ''control=list(nearpd=TRUE)''.)) + + + res <- rma.mv(yi, vi, mods = ~ group - 1, random = ~ group | trial, struct="UN", data=dat.long, method="ML", cvvc="varcov", control=list(nearpd=TRUE)) + + + Now ''res$vvc'' contains the variance-covariance matrix of the estimates in ''res$G'': + + + res$vvc + + + tau^2.1 cov tau^2.2 + tau^2.1 0.9359073 0.6711028 0.4822374 + cov 0.6711028 0.5245460 0.4066553 + tau^2.2 0.4822374 0.4066553 0.3399395 + + + We can then use this matrix as part of the input to ''matreg()'', that is, instead of specifying the sample size via argument ''n'' as was done above, we specify argument ''V'' with this matrix as input: + + + matreg(y=2, x=1, R=res$G, cov=TRUE, means=coef(res), V=res$vvc) + + + + estimate se zval pval ci.lb ci.ub + intrcpt -1.8437 0.3548 -5.1967 <.0001 -2.5391 -1.1484 *** + CON 0.7300 0.0866 8.4276 <.0001 0.5602 0.8998 *** + + + Now the standard error of the coefficient of interest is computed in such a way that it correctly takes the imprecision of the estimates in ''res$G'' into consideration. ==== Meta-Regression ==== ==== Meta-Regression ==== 