Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/predict.mvmeta.R
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.
1 2 3 4 |
object |
an object of class |
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 |
na.action |
a function which indicates what should happen when the data contain |
... |
further arguments passed to or from other methods. |
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.
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.
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
.
Antonio Gasparrini, antonio.gasparrini@lshtm.ac.uk
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 blup
for best linear unbiased predictions. See the default method predict
. See mvmeta-package
for an overview of the package and modelling framework.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.