R/mixoutsamp.R
mixoutsamp.RdThis function allows the user to make out-of-sample predictions from an LME model.
mixoutsamp(model, newdata)| model | Object of class |
|---|---|
| newdata | Data frame containing data for which to make predictions. The response variable should be set to NA for the rows of the data the user wishes to make predictions for. The columns in the data should have the same names as those used to fit the model. The variables should also be of the same type as in the data used to fit the mixed model (numeric, factor etc). |
List containing preddata and random. Data frame preddata is a version of newdata updated to contain columns corresponding to the fixed effects values (fixed),
random effects values (random), and fitted values (fitted).
Data frame random contains the values of random effects components for each individual.
This code was originally written by Ruth Keogh (London School of Hygiene and Tropical Medicine) which can be viewed at github.com/ruthkeogh/landmark_CF. There have been further contributions from Jessica Barrett (MRC Biostatistics Unit, University of Cambridge), David Stevens (University of Liverpool), and Mike Sweeting (University of Leicester).