predict.mvmeta: Predicted Values from mvmeta Models

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/predict.mvmeta.R

Description

This method function computes predictions from fitted univariate or multivariate meta-analytical models represented in objects of class "mvmeta", optionally for a new set of predictor values in meta-regression models. Predictions are optionally accompanied by standard errors, confidence intervals or the entire (co)variance matrix of the predicted outcomes.

Usage

1
2
3
4
## S3 method for class 'mvmeta'
predict(object, newdata, se=FALSE, ci=FALSE, vcov=FALSE,
  interval=c("confidence","prediction"), ci.level=0.95,
  format=c("matrix","list"), aggregate=c("stat","y"), na.action=na.pass, ...)

Arguments

object

an object of class "mvmeta".

newdata

An optional data frame in which to look for variables values with which to predict from meta-regression models.

se

logical switch indicating if standard errors must be included.

ci

logical switch indicating if confidence intervals must be included.

vcov

logical switch indicating if the (co)variance matrix must be included.

interval

type of prediction. See Details.

ci.level

a numerical value between 0 and 1, specifying the confidence level for the computation of confidence intervals.

format

the format for the returned results. See Value.

aggregate

when format="matrix" and se or ci are required, the results may be aggregated by statistic or by outcome. See Value

na.action

a function which indicates what should happen when the data contain NAs. The default to the value saved in object. See Note.

...

further arguments passed to or from other methods.

Details

The method function predict produces predicted values from mvmeta objects, obtained by evaluating the original call to mvmeta in the frame newdata. For both fixed and random-effects models, estimated predictions are only based on the fixed part of the model, ignoring study-specific deviations, differently from blup.

For random-effects models, if interval="confidence" (the default), standard errors, confidence intervals and (co)variance matrix of the predicted values are computed only using the estimated (co)variance matrix of the fixed-effects coefficients. If interval="prediction", the estimated between-study (co)variance matrix, stored in the Psi component of mvmeta objects, is also added. In this case, interpretation of the uncertainty reflects that of a new single study sampled from the same population.

If newdata is omitted, the predictions are based on the data used for the fit. In that case how to handle predictions for studies removed from estimation due to invalid missing pattern is determined by the na.action argument used in mvmeta to produce object. If na.action=na.omit, studies excluded from estimation will not appear, whereas if na.action=na.exclude they will appear, with values set to NA for all the outcomes. This step is performed by napredict. See Notes.

Value

The results may be aggregated in matrices (the default), or returned as lists, depending on the argument format. For multivariate models, the aggregation is ruled by the argument aggregate, and the results may be grouped by statistic or by outcome. If vcov=TRUE, lists are always returned.

Note

The definition of missing in model frames used for estimation in mvmeta is different than that commonly adopted in other regression models such as lm or glm. See info on missing values in mvmeta.

Author(s)

Antonio Gasparrini, antonio.gasparrini@lshtm.ac.uk

References

Sera F, Armstrong B, Blangiardo M, Gasparrini A (2019). An extended mixed-effects framework for meta-analysis.Statistics in Medicine. 2019;38(29):5429-5444. [Freely available here].

Gasparrini A, Armstrong B, Kenward MG (2012). Multivariate meta-analysis for non-linear and other multi-parameter associations. Statistics in Medicine. 31(29):3821–3839. [Freely available here].

See Also

See blup for best linear unbiased predictions. See the default method predict. See mvmeta-package for an overview of the package and modelling framework.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# RUN THE MODEL
model <- mvmeta(cbind(PD,AL)~pubyear,S=berkey98[5:7],data=berkey98)

# PREDICTED FROM YEAR 1985 TO 1987, WITH LABELS
newdata <- data.frame(pubyear=1985:1987,row.names=1985:1987)

# AVERAGED OUTOCOMES AND SE
predict(model,newdata,se=TRUE)

# SAME AS ABOVE, AGGREGATED BY OUTCOME
predict(model,newdata,se=TRUE,aggregate="y")

# SAME AS ABOVE, WITH PREDICTION INTERVALS
predict(model,newdata,se=TRUE,aggregate="y",interval="prediction")

# WITH VCOV, FORCED TO A LIST
predict(model,newdata,se=TRUE,vcov=TRUE,aggregate="y")

mvmeta documentation built on Dec. 10, 2019, 5:07 p.m.