Learn R Programming

mdsdt (version 1.2)

GOF: Conduct goodness of fit tests

Description

Includes a number of common goodness of fit measures to compare different GRT models.

Usage

GOF(grtMod, teststat = "X2", observed = NULL)

Arguments

grtMod
a grt object
teststat
a string indicating which statistic to use in the test. May be one of the following:
  • 'X2'for a chi-squared test
  • 'G2'for a likelihood-ratio G-test
  • 'AIC'for Akaike information criterion score
  • 'AIC.c'for the AIC with finite sample size correction
  • 'BIC'for Bayesian information criterion score
observed
optional, to provide a matrix of observed frequencies if no fit conducted.

Examples

Run this code
data(thomas01a)
fit1 <- fit.grt(thomas01a)
fit2 <- fit.grt(thomas01a, PI = 'same_rho')

# Take the model with the lower AIC
GOF(fit1, teststat = 'AIC')
GOF(fit2, teststat = 'AIC')

Run the code above in your browser using DataLab