Learn R Programming

metafor (version 0.5-0)

blup.rma.uni: Best Linear Unbiased Predictions for rma.uni Objects

Description

The function calculates the best linear unbiased predictions (BLUPs) of the true outcomes by combining the fitted values based on the fixed effects and the estimated contributions of the random effects for objects of class "rma.uni". Corresponding standard errors and prediction interval bounds are also provided.

Usage

## S3 method for class 'rma.uni':
blup(x, level=x$level, digits=x$digits, transf=FALSE, targs=NULL, ...)

Arguments

x
an object of class "rma.uni".
level
a numerical value between 0 and 100 specifying the prediction interval level (the default is to take the value from the object).
digits
an integer specifying the number of decimal places to which the printed results should be rounded (the default is to take the value from the object).
transf
an optional argument specifying the name of a function that should be used to transform the predicted values and interval bounds (e.g., transf=exp). Defaults to FALSE, which means that no transformation is used.
targs
optional arguments needed by the function specified under transf.
...
other arguments.

Value

  • An object of class "rma.list". The object is a list containing the following components:
  • predpredicted values.
  • secorresponding standard errors.
  • pi.lblower bound of the prediction intervals.
  • pi.ubupper bound of the prediction intervals.
  • ...some additional elements/values.
  • The "rma.list" object is formated and printed with print.rma.list.

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.

See Also

rma.uni, predict.rma.uni, fitted.rma

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log risk rates using a random-effects model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, 
           data=dat.bcg, measure="RR", method="REML")
blup(res, transf=exp)

### illustrate shrinkage of BLUPs towards the (estimated) population average
rri <- exp(escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)$yi)
blupi <- blup(res, transf=exp)$pred
plot(NA, NA, xlim=c(.8,2.2), ylim=c(0,2), pch=19, 
     xaxt="n", bty="n", xlab="", ylab="Relative Risk")
segments(rep(1,13), rri, rep(2,13), blupi, col="gray")
points(rep(1,13), rri,   pch=19)
points(rep(2,13), blupi, pch=19)
axis(side=1, at=c(1,2), labels=c("Observed Values", "BLUPs"), lwd=0)
abline(h=predict(res, transf=exp)$pred, lwd=2)

Run the code above in your browser using DataLab