Generic function for SEM AIC(c) score

# S3 method for psem
AIC(object, ..., AIC.type = "loglik", aicc = FALSE)

Arguments

object

a psem object

...

additional arguments to AIC

AIC.type

whether the log-likelihood "loglik" or d-sep "dsep" AIC score should be reported. Default is "loglik"

aicc

whether correction for small sample size should be applied. Default is FALSE

Examples


mod <- psem(
lm(rich ~ cover, data = keeley),
lm(cover ~ firesev, data = keeley),
lm(firesev ~ age, data = keeley),
data = keeley
)

# Get log-likelihood based AIC
AIC(mod)
#>        AIC K  n
#> 1 1103.492 9 90

# Get d-sep based AIC
AIC(mod, AIC.type = "dsep")
#>      AIC K  n
#> 1 35.136 9 90