gof {slca}R Documentation

Goodness of Fit Tests for Estimated slca Model

Description

Provides AIC, BIC and deviance statistic (G-squared) for goodness of fit test for the fitted model. Absolute model fit can be tested with deviance statistics, if test argument is specified.

Usage

gof(object, ...)

## S3 method for class 'slca'
gof(
   object, ..., test = c("none", "chisq", "boot"), nboot = 100,
   maxiter = 100, tol = 1e-6, verbose = FALSE
)

Arguments

object

an object of class slca and estimated.

...

additional objects of class slca and estimated.

test

a character string specifying the type of test to be conducted. If "chisq", a chi-squared test is conducted. If "boot", a bootstrap test is conducted.

nboot

an integer specifying the number of bootstrap rounds to be performed.

maxiter

an integer specifying maximum number of iterations allowed for the estimation process of each bootstrapping round.

tol

a numeric value setting tolerance for the convergence of each bootstrapping round.

verbose

a logical value indicating whether to print progress updates on the number of bootstrapping rounds completed.

Value

A data.frame containing the number of parameters (Df), loglikelihood, AIC, BIC, G-squared statistics, and the residual degree of freedom for each object. Depending on the test argument, the p-value for the corresponding statistical test may also be included.

See Also

compare

Examples

library(magrittr)
data <- gss7677[gss7677$COHORT == "YOUNG", ]
stat2 <- slca(status(2) ~ PAPRES + PADEG + MADEG) %>%
   estimate(data = data)
stat3 <- slca(status(3) ~ PAPRES + PADEG + MADEG) %>%
   estimate(data = data)
stat4 <- slca(status(4) ~ PAPRES + PADEG + MADEG) %>%
   estimate(data = data)

gof(stat2, stat3, stat4)
gof(stat2, stat3, stat4, test = "chisq")

gof(stat2, stat3, stat4, test = "boot")


compare(stat3, stat4)
compare(stat3, stat4, test = "chisq")

compare(stat3, stat4, test = "boot")


[Package slca version 1.0.0 Index]