plot | R Documentation |
Plots the outcome probabilities for a randomLCA object, for random effects objects this can be either marginal or conditional or both. For a 2 level random effects model conditional2 will condition on the subject random effect and integrate over the period random effects. Note that plot is based on the xyplot function.
## S3 method for class 'randomLCA'
plot(x, ... , graphtype = ifelse(x$random, "marginal", "conditional"),
conditionalp = 0.5, classhorizontal = TRUE)
x |
randomLCA object |
graphtype |
Type of graph |
conditionalp |
For a conditional graph the percentile corresponding to the random effect at which the outcome probability is to be calculated |
classhorizontal |
classes to be plotted across the page |
... |
additional parameters to xyplot |
Ken Beath ken.beath@mq.edu.au
calcCondProb
, calcMargProb
# standard latent class with 2 classes
uterinecarcinoma.lca2 <- randomLCA(uterinecarcinoma[, 1:7], freq = uterinecarcinoma$freq, cores = 1)
plot(uterinecarcinoma.lca2)
uterinecarcinoma.lcarandom2 <- randomLCA(uterinecarcinoma[, 1:7],
freq = uterinecarcinoma$freq, random = TRUE, probit = TRUE, quadpoints = 61, cores = 1)
# default for random effects models is marginal
plot(uterinecarcinoma.lcarandom2)
# default for random effects models conditional is p = 0.5 i.e. median
plot(uterinecarcinoma.lcarandom2, graphtype = "conditional")
# look at variability by plotting conditional probabilities at 0.05, 0.5 and 0.95
plot(uterinecarcinoma.lcarandom2, graphtype = "conditional", conditionalp = c(0.05, 0.5, 0.95))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.