hivtests | R Documentation |
Serum samples are tested for HIV by 4 different biossays in Alvord et al (1988) and sensitivity and specificity determined using latent class analysis. Qu et al (1996) repeat the analysis using a model incorporating a random effect.
hivtests
A data frame with 16 observations on the following 5 variables.
V1
Test 1
V2
Test 2
V3
Test 3
V4
Test 4
freq
Number of subjects
Qu, Tan and Kutner (1989)
Alvord, W.G., Drummond, J.E., Arthur, L.O., Goedert, J.J., Levine, P.H., Murphy, E.L., Weiss, S.H., and Blattner, W.A. (1988) A method for predicting individual HIV infection status in the absence of clinical information. AIDS Research and Human Retroviruses, 4, 295–304.
Qu, Y., Tan, M. and Kutner, M.H. (1996) Random effects models in latent class analysis for evaluating accuracy of diagnostic tests. Biometrics, 52, 797–810.
# fit standard latent class
hivtests.lca2 <- randomLCA(hivtests[, 1:4], freq = hivtests$freq, cores = 1)
# with random effect and constant loading
hivtests.lca2random <- randomLCA(hivtests[, 1:4], freq = hivtests$freq, random = TRUE,
quadpoints = 101, penalty = 1.0, cores = 1)
# with random effect and variable loading
# for this model there are 13 parameters fitted to 16 observations, so model is fairly unstable
hivtests.lca2random2 <- randomLCA(hivtests[, 1:4], freq = hivtests$freq, random = TRUE,
constload = FALSE, quadpoints = 101, penalty = 1.0, cores = 1)
# BIC shows best model is random effects with constant loading
print(c(BIC(hivtests.lca2), BIC(hivtests.lca2random), BIC(hivtests.lca2random2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.