ctFitCovCheck | R Documentation |
Visual model-fit diagnostics for ctsem fits, optionally split by the mean of a chosen observed variable.
ctFitCovCheck(fit, cor = FALSE, plot = TRUE, splitby = NULL)
fit |
A 'ctStanFit' object. |
cor |
Logical; if 'TRUE' correlations are analysed instead of covariances. |
plot |
Logical; if 'TRUE' (default) a 'ggplot2' object (or list of plots) is returned. If 'FALSE', the raw 'data.table' with diagnostics is returned. |
splitby |
Optional character string giving the variable name on which to split subjects. |
Either a plot/list of plots (default, given by 'plot.ctFitCovCheck') or a 'data.table'.
ctFitCovCheck(ctstantestfit, cor = TRUE, plot = TRUE)
gg=ctFitCovCheck(ctstantestfit, cor = FALSE, plot = TRUE, splitby = "TI1")
print(gg[[1]]+
ggplot2::ggtitle("Covariance Check for Y1 with all other manifest variables, split by TI1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.