lme2 {ClusROC} | R Documentation |
lme2
fits the cluster-effect model for a continuous diagnostic test in a three-class setting as described in Xiong et al. (2018) and To et al. (2022).
lme2(
fixed.formula,
name.class,
name.clust,
data,
levl.class = NULL,
apVar = TRUE,
boxcox = FALSE,
interval_lambda = c(-2, 2),
trace = TRUE,
...
)
fixed.formula |
a two-sided linear formula object, describing the fixed-effects part of the model for three classes, with the response on the left of ~ operator and the terms, separated by + operators, on the right. For example, |
name.class |
name of variable indicating disease classes (or diagnostic groups) in the data. |
name.clust |
name of variable indicating clusters in the data. |
data |
a data frame containing the variables in the model. |
levl.class |
a vector (of strings) containing the ordered name chosen for the disease classes. The ordering is intended to be “increasing” with respect to the disease severity. If |
apVar |
a logical value. Default = |
boxcox |
a logical value. Default = |
interval_lambda |
a vector containing the end-points of the interval for searching the Box-Cox parameter, |
trace |
a logical value. Default = |
... |
additional arguments for |
This function fits a linear mixed-effect model for a continuous diagnostic test in a three-class setting in order to account for the cluster and covariates effects on the test result. See Xiong et al. (2018) and To et al. (2022) for more details.
Estimation is done by using lme
with the restricted maximum log-likelihood (REML) method.
Box-Cox transformation for the model can be used when the distributions of test results are skewed (Gurka et al. 2006). The estimation procedure is described in To et al. (2022). The Box-Cox parameter \lambda
is estimated by a grid search on the interval (-2, 2), as discussed in Gurka and Edwards (2011).
The estimated variance-covariance matrix for the estimated parameters are obtained by sandwich formula (see, Liang and Zeger, 1986; Kauermann and Carroll, 2001; Mancl and DeRouen, 2001) as discussed in To et al. (2022).
lme2
returns an object of class "lme2" class, i.e., a list containing at least the following components:
call |
the matched call. |
est_para |
a vector containing the estimated parameters. |
se_para |
a vector containing the standard errors. |
vcov_sand |
the estimated covariance matrix for all estimated parameters. |
residual |
a list of residuals. |
fitted |
a list of fitted values. |
randf |
a vector of estimated random effects for each cluster level. |
n_coef |
total number of coefficients included in the model. |
n_p |
total numbers of regressors in the model. |
icc |
an estimate of intra-class correlation - ICC |
terms |
the |
boxcox |
logical value indicating whether the Box-Cox transformation was applied or not. |
Generic functions such as print
and plot
are also used to show results of the fit.
Gurka, M. J., Edwards, L. J. , Muller, K. E., and Kupper, L. L. (2006) “Extending the Box-Cox transformation to the linear mixed model”. Journal of the Royal Statistical Society: Series A (Statistics in Society), 169, 2, 273-288.
Gurka, M. J. and Edwards, L. J. (2011) “Estimating variance components and random effects using the box-cox transformation in the linear mixed model”. Communications in Statistics - Theory and Methods, 40, 3, 515-531.
Kauermann, G. and Carroll, R. J. (2001) “A note on the efficiency of sandwich covariance matrix estimation”. Journal of the American Statistical Association, 96, 456, 1387-1396.
Liang, K. Y. and Zeger, S. L. (1986) “Longitudinal data analysis using generalized linear models”. Biometrika, 73, 1, 13-22.
Mancl, L. A. and DeRouen, T. A. (2001) “A covariance estimator for GEE with improved small-sample properties”. Biometrics, 57, 1, 126-134.
To, D-K., Adimari, G., Chiogna, M. and Risso, D. (2022) “Receiver operating characteristic estimation and threshold selection criteria in three-class classification problems for clustered data”. Statistical Methods in Medical Research, DOI: 10.1177/09622802221089029.
Xiong, C., Luo, J., Chen L., Gao, F., Liu, J., Wang, G., Bateman, R. and Morris, J. C. (2018) “Estimating diagnostic accuracy for clustered ordinal diagnostic groups in the three-class case – Application to the early diagnosis of Alzheimer disease”. Statistical Methods in Medical Research, 27, 3, 701-714.
## Example 1:
data(data_3class)
head(data_3class)
## A model with two covariate: X1 + X2
out1 <- lme2(fixed.formula = Y ~ X1 + X2, name.class = "D", name.clust = "id_Clus",
data = data_3class)
print(out1)
plot(out1)
## Example 2: Box-Cox transformation
data(data_3class_bcx)
out2 <- lme2(fixed.formula = Y ~ X, name.class = "D", name.clust = "id_Clus",
data = data_3class_bcx, boxcox = TRUE)
print(out2)
plot(out2)