I'd like to quickly compare AICs that are provided as output when running summary()
on individual polr()
models created using the MASS
package in R. I have no problem compiling this info, but what I can't figure out is where exactly the AIC info is being stored in the polr
model objects themselves.
I've tried using str()
and attributes()
on my model objects, and I've even tried using getAnywhere("polr")
to look at the source code itself. Nothing is standing out to me.
Anyone know how to extract AIC output from summary(polr_mod)
?
Example for reference:
library(MASS)
dat <- data.frame(v1 = factor(rep(0:2,each=3),ordered = T), v2 = rep(1:3,each=3))
mod_polr <- polr(v1 ~ v2, data = dat, Hess = T, method = "logistic" )
summary(mod_polr)
Call:
polr(formula = v1 ~ v2, data = dat, Hess = T, method = "logistic")
Coefficients:
v2
46.7233
Intercepts:
0|1 1|2
73.62014 117.05781
Residual Deviance: 1.560782e-08
AIC: 6.00
^ See, at the bottom of the output is AIC: 6.00
. Where is this stored in the object? I'd like to call/extract it.