ctsem (version 3.0.4)

ctCheckFit: Check absolute fit of ctFit or ctStanFit object.

Description

Check absolute fit of ctFit or ctStanFit object.

Usage

ctCheckFit(fit, niter = 500, probs = c(0.025, 0.5, 0.975))

Arguments

fit

ctFit or ctStanFit object.

niter

number of data generation iterations to use to calculate quantiles.

probs

3 digit vector of quantiles to return and to test significance.

Value

List containing a means and cov object, computed by sorting data into discrete time points. cov is a numeric matrix containing measures of the covariance matrices for observed and simulated data. The MisspecRatio column shows Z score difference for each lower triangular index of the covariance matrix of data -- observed covariance minus mean of generated, weighted by sd of generated covariance. means contains the empirical and generated data means.

Details

for plotting help see plot.ctsemFitMeasure

Examples

Run this code
# NOT RUN {
data(ctExample1)
traitmodel <- ctModel(n.manifest=2, n.latent=2, Tpoints=6, LAMBDA=diag(2), 
  manifestNames=c('LeisureTime', 'Happiness'), 
  latentNames=c('LeisureTime', 'Happiness'), TRAITVAR="auto")
traitfit <- ctFit(dat=ctExample1, ctmodelobj=traitmodel)

check <- ctCheckFit(traitfit,niter=5)
plot(check)
# }

Run the code above in your browser using DataLab