Learn R Programming

piecewiseSEM (version 2.3.0)

AIC.psem: Generic function for SEM AIC(c) score

Description

Generic function for SEM AIC(c) score

Usage

# 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

Run this code

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)

# Get d-sep based AIC
AIC(mod, AIC.type = "dsep")
 

Run the code above in your browser using DataLab