addPredictions {FluMoDL} | R Documentation |
Add predictions to summary.FluMoDL objects
Description
This function uses the data available in a FluMoDL object
to generate predictions (in the form of crosspred
objects) for a
summary.FluMoDL
object.
Usage
addPredictions(s, m)
Arguments
s |
An object of class |
m |
An object of class FluMoDL, which provides the original (untransformed) predictor data to create the predictions. |
Details
Creating a cross-basis matrix (to use as covariate in a Distributed-Lag Nonlinear Model) transforms and scales the original predictor. Interpreting the model coefficients requires revisiting the cross-basis matrix and backtransforming to the original predictor, in order to generate predicted effect estimates for specific values of predictor and lag.
For this reason, summary.FluMoDL
objects created from a
multivariate meta-analysis, containing pooled or BLUP coefficients,
do not contain predictions (their $pred
element is NULL
)
because they have no reference to an original predictor.
This is what addPredictions()
does: it uses the cross-basis matrices from a
FluMoDL object m
to calculate predictions with the coefficients in
the summary.FluMoDL
object s
. It provides the necessary
"context" in which to interpret the model coefficients.
Value
The function returns the summary.FluMoDL
object s
,
with predictions added (as element $pred
)
See Also
summary.FluMoDL
, fitFluMoDL
,
crosspred