metareg {gap} | R Documentation |
Fixed and random effects model for meta-analysis
Description
Fixed and random effects model for meta-analysis
Usage
metareg(data, N, verbose = "Y", prefixb = "b", prefixse = "se")
Arguments
data |
Data frame to be used. |
N |
Number of studies. |
verbose |
A control for screen output. |
prefixb |
Prefix of estimate; default value is "b". |
prefixse |
Prefix of standard error; default value is "se".
The function accepts a wide format data with estimates as |
Details
Given studies with
being
's and
standard errors from regression, the fixed effects
model uses inverse variance weighting such that
, ...,
and the combined
as the weighted average,
, with
being the total weight, the se for this estimate is
.
A normal z-statistic is obtained as
, and the
corresponding p value
. For the random effects
model, denote
and
, corrected
weights are obtained such that
, ...,
, totaling
.
The combined
and se are then
and
, leading to a z-statistic
and a p-value
. Moreover, a
p-value testing for heterogeneity is
.
Value
The returned value is a data frame with the following variables:
p_f P value (fixed effects model).
p_r P value (random effects model).
beta_f regression coefficient.
beta_r regression coefficient.
se_f standard error.
se_r standard error.
z_f z value.
z_r z value.
p_heter heterogeneity test p value.
i2
statistic.
k No of tests used.
eps smallest double-precision number.
Note
Adapted from a SAS macro, 23-7-2009 MRC-Epid JHZ
Author(s)
Shengxu Li, Jing Hua Zhao
References
Higgins JP, Thompson SG, Deeks JJ, Altman DG (2003). “Measuring inconsistency in meta-analyses.” BMJ, 327(7414), 557-60. ISSN 0959-8138 (Print) 0959-8138, doi:10.1136/bmj.327.7414.557.
Examples
## Not run:
abc <- data.frame(chromosome=1,rsn='abcd',startpos=1234,
b1=1,se1=2,p1=0.1,b2=2,se2=6,p2=0,b3=3,se3=8,p3=0.5)
metareg(abc,3)
abc2 <- data.frame(b1=c(1,2),se1=c(2,4),b2=c(2,3),se2=c(4,6),b3=c(3,4),se3=c(6,8))
print(metareg(abc2,3))
## End(Not run)