The function calculates 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, …)

Arguments

object

an object of class "rma.uni" or "rma.mv".

level

numerical value between 0 and 100 specifying the prediction interval level (if unspecified, the default is to take the value from the object).

digits

integer specifying 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).

transf

optional argument specifying the name of a function that should be used to transform the predicted values and interval bounds (e.g., transf=exp; see also transf). If unspecified, no transformation is used.

targs

optional arguments needed by the function specified under transf.

verbose

logical indicating whether output should be generated on the progress of the computations (the default is FALSE).

other arguments.

Value

For objects of class "rma.uni", an object of class "list.rma". The object is a list containing the following components:

pred

predicted values.

se

corresponding standard errors.

pi.lb

lower bound of the prediction intervals.

pi.ub

upper bound of the prediction intervals.

some additional elements/values.

The "list.rma" object is formatted and printed with print.list.rma. For objects of class "rma.mv", a list of data frames with the same components as described above.

Note

For best linear unbiased predictions that combine the fitted values based on the fixed effects and the estimated contributions of the random effects, see blup.

For predicted/fitted values that are based only on the fixed effects of the model, see fitted.rma and predict.rma.

Fixed-effects models (with or without moderators) do not contain random study effects. The BLUPs for these models will therefore be 0.

When using the transf argument, the transformation is applied to the predicted values and the corresponding interval bounds. The standard errors are then set equal to NA and are omitted from the printed output.

The normal distribution is used to calculate the prediction intervals. When the model was fitted with the Knapp and Hartung (2003) method (i.e., test="knha" in the rma.uni function), then the t-distribution with \(k-p\) degrees of freedom is used.

To be precise, it should be noted that the function actually calculates empirical BLUPs (eBLUPs), since the predicted values are a function of the estimated variance component(s).

References

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, 1249--1261.

Raudenbush, S. W., & Bryk, A. S. (1985). Empirical Bayes meta-analysis. Journal of Educational Statistics, 10, 75--98.

Robinson, G. K. (1991). That BLUP is a good thing: The estimation of random effects. Statistical Science, 6, 15--32.

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. http://www.jstatsoft.org/v36/i03/.

See also

Examples

### 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)
#> #> pred se pi.lb pi.ub #> 1 -0.0857 0.4092 -0.8877 0.7163 #> 2 -0.5372 0.3638 -1.2501 0.1758 #> 3 -0.2724 0.4296 -1.1144 0.5696 #> 4 -0.6834 0.2176 -1.1099 -0.2568 #> 5 0.4272 0.2606 -0.0835 0.9378 #> 6 -0.0700 0.1942 -0.4506 0.3105 #> 7 -0.5294 0.3759 -1.2662 0.2073 #> 8 0.7174 0.1882 0.3485 1.0863 #> 9 0.2077 0.2665 -0.3146 0.7300 #> 10 -0.5326 0.2837 -1.0886 0.0234 #> 11 0.3609 0.2046 -0.0401 0.7618 #> 12 0.4298 0.4491 -0.4504 1.3100 #> 13 0.5678 0.2821 0.0149 1.1207 #>