Description Usage Arguments Details Value Author(s) References Examples
Filters random components of the mixed model with a stationary or non-stationary stochastic process component, under multivariate normal response distribution
1 |
formula |
a typical |
data |
a data frame from which the variables are to be extracted |
id |
a vector for subject identification |
process |
a character string, |
timeVar |
a vector for the time variable at which filtered values are required |
estimate |
a vector for the maximum likelihood estimates |
subj.id |
a vector for IDs of the subjects for whom filtering will be carried out |
For the details of process
, see lmenssp
.
Returns the results as lists for the random intercept and stochastic process
Ozgur Asar, Peter J. Diggle
Diggle PJ, Sousa I, Asar O (2015) Real time monitoring of progression towards renal failure in primary care patients. Biostatistics, 16(3), 522-536.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # loading the data set and subsetting it for the first 20 patients
# for the sake illustration of the usage of the functions
data(data.sim.ibm)
data.sim.ibm.short <- data.sim.ibm[data.sim.ibm$id <= 20, ]
# model formula to be used below
formula <- log.egfr ~ sex + bage + fu + pwl
# obtaining the maximum likelihood estimates of the model
# parameters for the model with integrated Brownian motion
fit.ibm <- lmenssp(formula = formula, data = data.sim.ibm.short,
id = data.sim.ibm.short$id, process = "ibm", timeVar = data.sim.ibm.short$fu,
silent = FALSE)
fit.ibm
# filtering for subjects with ID=1 and 2
subj.id <- c(1, 2)
fil.res <- filtered(formula = formula, data = data.sim.ibm.short,
id = data.sim.ibm.short$id, process = "ibm", timeVar = data.sim.ibm.short$fu,
estimate = fit.ibm$estimate[, 1], subj.id = subj.id)
fil.res
# filtering for a new (hypothetical) subject
data.501 <- data.frame(id = c(501, 501, 501), sex = c(0, 0, 0),
bage = c(50, 50, 50), fu = c(0, 0.2, 0.4),
pwl = c(0, 0, 0), log.egfr = c(4.3, 2.1, 4.1))
data.501
fil.501 <- filtered(formula = formula, data = data.501,
id = data.501$id, process = "ibm", timeVar = data.501$fu,
estimate = fit.ibm$estimate[, 1], subj.id = 501)
fil.501
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.