R: Function to obtain the maximum likelihood estimates of the...
lmenssp
R Documentation
Function to obtain the maximum likelihood estimates of the parameters for linear mixed effects models with
random intercept and a stationary or non-stationary stochastic process component, under multivariate normal
response distribution
Description
Obtains the maximum likelihood estimates of the parameters for linear mixed effects models with
random intercept and a stationary or non-stationary stochastic process component, under multivariate
normal response distribution
Usage
lmenssp(formula, data = NULL, id, process = "bm", timeVar, init = NULL, tol = 1e-05,
maxiter = 100, silent = TRUE)
Arguments
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 numerical vector for subject identification
process
a character string for the stochastic process: "bm" for Brownian motion,
"ibm" for integrated Brownian motion, "iou" for integrated
Ornstein-Uhlenbeck process, "sgp-powered-power-method" for stationary process
with powered correlation function (for the usage, see the details below) and
"sgp-matern-kappa" for stationary process with Matern correlation
function (for the usage, see the details below)
timeVar
a numerical vector for the time variable
init
a numerical vector of initial values for the variance parameters to
start the Fisher-Scoring or Nelder-Mead algorithms;
if the user does not provide their own values lmenssp obtains these by fitting a
random intercept and random slope model using the lme function of the nlme
package; for details see the details below
tol
a numerical value for the maximum tolerance to assess the convergence
maxiter
a numerical value for the number of iterations for the Fisher-Scoring or Nelder-Mead algorithms
silent
a character string, if set to FALSE the details of the Fisher-Scoring steps are printed when
the algorithm is running
Details
For "process", "sgp-powered-power-method" is a general form for stationary process
with powered correlation function. "power" is the shapre parameter and
corresponds to "c" in
exp(-|t-s|^c/φ),
where t and s are two time points and φ is the scale parameter,
and "method" might be "fs" for Fisher-Scoring or "nm" for Nelder-Mead.
Some examples are: "sgp-powered-1-fs" for stationary process with exponential correlation
function with Fisher-Scoring algorithm and
"sgp-powered-2-nm" for stationary process with Gaussian correlation
function with Nelder-Mead algorithm. Similarly, "sgp-matern-kappa" is a general form for
stationary process with Matern correlation
function. "kappa" is the shape parameter and corresponds to κ in
t and s are two time points and ν is the scale parameter.
An example is "sgp-matern-0.5" for
stationary process with exponential correlation function. Nelder-Mead algorithm is automatically specified
for the choice of Matern, i.e. Fisher-Scoring is not available.
"init" assumes the following:
- 3 element vectors for "process = bm" and "process = ibm", with initials for the
variances of random intercept, stochastic process and measurement error, respectively
- 4 element vector for "process = iou", with initials for the variance of
random intercept variance, (two) parameters of the stochastic process, variance of measurement error
- 3 element vector for "process = sgp-powered-power-fs", with initials for
log of the fraction of the variance of random intercept and variance of the process,
log(φ) and log of the fraction of the variance of measurement error and
variance of the process.
- NULL for any of the specification of "process", in which case lmenssp
finds the initals internally using the lme function of the nlme package.
Value
Returns the results as lists
Author(s)
Ozgur Asar, Peter J. Diggle
References
Diggle PJ (1988) An approach to the analysis of repeated measurements. Biometrics, 44, 959-971.
Diggle PJ, Sousa I, Asar O (2015) Real time monitoring of progression towards renal failure in primary care patients.
Biostatistics, 16(3), 522-536.
Taylor JMG, Cumberland WG, Sy JP (1994) A Stochastic Model for Analysis of Longitudinal AIDS Data.
Journal of the American Statistical Association, 89, 727-736.
Examples
# 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, ]
# fitting the model with integrated Brownian motion
fit.ibm <- lmenssp(log.egfr ~ sex + bage + fu + pwl, data = data.sim.ibm.short,
id = data.sim.ibm.short$id, process = "ibm", timeVar = data.sim.ibm.short$fu,
silent = FALSE)
fit.ibm