predict.emdr2: Predictions from emdr2

Description Usage Arguments Details Value Examples

View source: R/emdr2.R

Description

Method predict for emdr2 objects.

Usage

1
2
## S3 method for class 'emdr2'
predict(object, newmimfs = NULL, newcovariates = NULL, method = "predict", ...)

Arguments

object

An emdr2 object.

newmimfs

Array of new MIMFs values for prediction. Number of IMFs and variables must match those of the mimf argument given in the emdr2 function. If NULL, the data used to fit the model are used.

newcovariates

Data.frame of new covariates value for prediction.

method

The name of a prediction method linked to the regression function used for emdr2.

...

Additional arguments for the predict method.

Details

If new data are given for prediction, both newmimfs and newcovariates must be given (provided covariates have been used in the model).

Value

A vector of predicted values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
   library(dlnm)

   dat <- chicagoNMMAPS[,c("death", "temp", "rhum")]

   mimfs <- memd(dat)
   cmimfs <- combine.mimf(mimfs, list(12:13, 14:17, 18:19), 
     new.names = c("C12", "C13", "r"))

   lm.R2 <- emdr2(death ~ temp + rhum, mimf = cmimfs)
   deathHat <- predict(lm.R2)

PierreMasselot/Library--emdr documentation built on June 19, 2021, 8:58 a.m.