Learn R Programming

ctsem (version 3.10.2)

ctChisqTest: Chi Square test wrapper for ctStanFit objects.

Description

Chi Square test wrapper for ctStanFit objects.

Usage

ctChisqTest(fit1, fit2)

Value

Numeric probability

Arguments

fit1

One of the fits to be compared (better fit is assumed as base for comparison)

fit2

Second fit to be compared

Examples

Run this code
# \donttest{
    df <- data.frame(id=1, time=1:length(sunspot.year), Y1=sunspot.year)
    
    m1 <- ctModel(type='standt', LAMBDA=diag(1),MANIFESTVAR=0)
    m2 <- ctModel(type='standt', LAMBDA=diag(1),MANIFESTVAR=0,DRIFT = .9)
    
    f1 <- ctStanFit(df,m1,cores=1)
    f2 <- ctStanFit(df,m2,cores=1)
    
    ctChisqTest(f1,f2)
# }

Run the code above in your browser using DataLab