Description Usage Arguments Details Value Author(s) References Examples
View source: R/smoothed.heavy.R
Smooths random components of the mixed model with a stationary or non-stationary stochastic process component, under multivariate t response distribution
1 | smoothed.heavy(formula, data, id, process, timeVar, estimate, subj.id = NULL)
|
formula |
a typical R formula for the fixed effects component of the model |
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 |
estimate |
a vector for the maximum likelihood estimates |
subj.id |
a vector of IDs of the subject for whom smoothing is to be carried out |
For details of "process"
see lmenssp
Returns the results as lists for the random intercept and stochastic process
Ozgur Asar, Peter J. Diggle
Asar O, Ritchie J, Kalra P, Diggle PJ (2015) Acute kidney injury amongst chronic kidney disease patients: a case-study in statistical modelling. To be submitted.
Pinheiro JC, Liu C, Wu YN. (2001) Efficient algorithms for robust estimation in linear mixed-effects models using the multivariate t distribution. Journal of Computational and Graphical Statistics 10, 249-276.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 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.heavy)
data.sim.ibm.heavy.short <- data.sim.ibm.heavy[data.sim.ibm.heavy$id <= 20, ]
# a formula to be used
formula <- log.egfr ~ sex + bage + fu + pwl
# estimating the parameters
# tol.em is set to 10^-1 and tol.lmenssp to 10^-2 only for illustration,
# decrease these values in your applications
fit.heavy <- lmenssp.heavy(formula = formula, data = data.sim.ibm.heavy.short,
id = data.sim.ibm.heavy.short$id, timeVar = data.sim.ibm.heavy.short$fu, init.em = 5,
maxiter.em = 1000, tol.em = 10^-1,
process = "ibm", silent = FALSE, dof.est = c(0.1, 10, 0.0001), tol.cd = 0.001,
tol.lmenssp = 10^-2, silent.lmenssp = FALSE)
fit.heavy
# smoothing for the patients with ID = 1, 2, 3, 4
smo.heavy <- smoothed.heavy(formula = formula, data = data.sim.ibm.heavy.short,
id = data.sim.ibm.heavy.short$id, process = "ibm", timeVar = data.sim.ibm.heavy.short$fu,
estimate = fit.heavy$est, subj.id = c(1, 2, 3, 4))
smo.heavy
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.