Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/predict.mixmeta.R
This method function computes predictions from fitted univariate or multivariate meta-analytical models represented in objects of class "mixmeta"
, 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 |
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. |
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 mixmeta
objects, obtained by evaluating the original call to mixmeta
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
.
If newdata
is omitted, the predictions are based on the data used for the fit. In that case how to handle predictions for units removed from estimation due to invalid missing pattern is determined by the na.action
argument used in mixmeta
to produce object
. If na.action=na.omit
, units 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 mixmeta
is different than that commonly adopted in other regression models such as lm
or glm
. See info on missing values
in mixmeta
.
Antonio Gasparrini <antonio.gasparrini@lshtm.ac.uk> and Francesco Sera <francesco.sera@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].
See blup
for best linear unbiased predictions. See the default method predict
. See mixmeta-package
for an overview of the package and modelling framework.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # RUN THE MODEL
model <- mixmeta(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="outcome")
# WITH VCOV, FORCED TO A LIST
predict(model, newdata, se=TRUE, vcov=TRUE, aggregate="outcome")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.