Learn R Programming

ctsem (version 2.8.2)

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

numeric matrix showing 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.

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