predict.rma.uni {metafor} | R Documentation |
The function calculates predicted values, corresponding standard errors, confidence intervals, and (approximate) credibility intervals for objects of class "rma.uni"
.
## S3 method for class 'rma.uni': predict(object, newmods=NULL, level=object$level, digits=object$digits, transf=FALSE, targs=NULL, ...)
object |
an object of class "rma.uni" . |
newmods |
an optional vector or matrix specifying the values of the moderator values for which the predicted values should be calculated. See ‘Details’. |
level |
a numerical value between 0 and 100 specifying the confidence and credibility 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. |
For the fixed-effects model, predict(object)
returns the estimated (average) outcome in the set of studies included in the meta-analysis. This is the same as the estimated intercept in the fixed-effects model.
For the random-effects model, predict(object)
returns the estimated (average) outcome in the hypothetical population of studies from which the set of studies included in the meta-analysis are assumed to be a random selection. This is the same as the estimated intercept in the random-effects model.
For models including one or more moderators, predict(object)
returns the estimated (average) outcomes for values of the moderator(s) equal to those of the k studies included in the meta-analysis (i.e., the fitted values for the k studies).
For models including q moderator variables, new moderator values for l new studies can be specified by setting newmods
equal to an l x q matrix with the corresponding new moderator values. An example is shown below.
For random/mixed-effects models, an approximate credibility interval is also calculated. The interval estimates where level
% of the true outcomes fall in the hypothetical population of studies. Note that this interval is calculated under the assumption that the value of tau^2 is known (and not estimated). A proper method for calculating a credibility interval that accounts for the uncertainty in the estimate of tau^2 will be implemented in the future.
An object of class "list.rma"
. The object is a list containing the following components:
pred |
predicted value(s). |
se |
corresponding standard error(s). |
ci.lb |
lower bound of the confidence interval(s). |
ci.ub |
upper bound of the confidence interval(s). |
cr.lb |
lower bound of the credibility interval(s) (only random/mixed-effects models). |
cr.ub |
upper bound of the credibility interval(s) (only random/mixed-effects models). |
... |
some additional elements/values. |
The "list.rma"
object is formated and printed with print.list.rma
.
The predicted values are based only on the fixed effects in the model. Best linear unbiased predictions (BLUPs) that combine the fitted values based on the fixed effects and the estimated contributions of the random effects can be obtained with blup.rma.uni
.
When using the transf
option, the transformation is applied to the predicted values and the corresponding interval bounds. The standard errors are set equal to NA
.
The normal distribution is used to calculate the confidence/credibility intervals. When the model was fitted with the Knapp and Hartung (2003) method (i.e., knha=TRUE
in the rma.uni
function), then the t-distribution with k-p degrees of freedom is used.
Wolfgang Viechtbauer; wvb@www.wvbauer.com; http://www.wvbauer.com/
Hedges, L. V. & Olkin, I. (1985) Statistical methods for meta-analysis. San Diego, CA: Academic Press.
Raudenbush, S. W. (1994) Random effects models. In H. C. Cooper & L. V. Hedges (Eds.), The handbook of research synthesis (pp. 301–321). New York: Russell Sage Foundation.
### load BCG vaccine data data(dat.bcg) ### meta-analysis of the log risk ratios using a random-effects model res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, measure="RR", data=dat.bcg, method="REML") ### average risk ratio with 95% CI predict(res, transf=exp) ### mixed-effects model with absolute latitude as a moderator res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=ablat, measure="RR", data=dat.bcg, method="REML") ### predicted average risk ratios for given absolute latitude values predict(res, transf=exp) ### predicted average risk ratios for 10-60 degrees absolute latitude predict(res, newmods=c(10, 20, 30, 40, 50, 60), transf=exp) ### mixed-effects model with two moderators (absolute latitude and publication year) res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=cbind(ablat, year), measure="RR", data=dat.bcg, method="REML") ### predicted average risk ratios for 10 and 60 degrees latitude in 1950 and 1980 predict(res, newmods=cbind(c(10,60,10,60),c(1950,1950,1980,1980)), transf=exp)