The function computes best linear unbiased predictions (BLUPs) of the random effects for objects of class "rma.uni"
and "rma.mv"
. Corresponding standard errors and prediction interval bounds are also provided.
# S3 method for rma.uni
ranef(object, level, digits, transf, targs, ...)
# S3 method for rma.mv
ranef(object, level, digits, transf, targs, verbose=FALSE, ...)
For objects of class "rma.uni"
, an object of class "list.rma"
. The object is a list containing the following components:
predicted values.
corresponding standard errors.
lower bound of the prediction intervals.
upper bound of the prediction intervals.
some additional elements/values.
The object is formatted and printed with the print
function. To format the results as a data frame, one can use the as.data.frame
function.
For objects of class "rma.mv"
, a list of data frames with the same components as described above.
an object of class "rma.uni"
or "rma.mv"
.
numeric value between 0 and 100 to specify the prediction interval level. If unspecified, the default is to take the value from the object.
optional integer to specify the number of decimal places to which the printed results should be rounded. If unspecified, the default is to take the value from the object.
optional argument to specify a function to transform the predicted values and interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used.
optional arguments needed by the function specified under transf
.
logical to specify whether output should be generated on the progress of the computations (the default is FALSE
).
other arguments.
Wolfgang Viechtbauer wvb@metafor-project.org https://www.metafor-project.org
Kackar, R. N., & Harville, D. A. (1981). Unbiasedness of two-stage estimation and prediction procedures for mixed linear models. Communications in Statistics, Theory and Methods, 10(13), 1249--1261. https://doi.org/10.1080/03610928108828108
Raudenbush, S. W., & Bryk, A. S. (1985). Empirical Bayes meta-analysis. Journal of Educational Statistics, 10(2), 75--98. https://doi.org/10.3102/10769986010002075
Robinson, G. K. (1991). That BLUP is a good thing: The estimation of random effects. Statistical Science, 6(1), 15--32. https://doi.org/10.1214/ss/1177011926
Searle, S. R., Casella, G., & McCulloch, C. E. (1992). Variance components. Hoboken, NJ: Wiley.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. https://doi.org/10.18637/jss.v036.i03
rma.uni
and rma.mv
for functions to fit models for which BLUPs of the random effects can be computed.
predict.rma
and fitted.rma
for functions to compute the predicted/fitted values based only on the fixed effects and blup.rma.uni
for a function to compute BLUPs that combine the fitted values and predicted random effects.
### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### meta-analysis of the log risk ratios using a random-effects model
res <- rma(yi, vi, data=dat)
### BLUPs of the random effects
ranef(res)
Run the code above in your browser using DataLab