How to extract the aic from glm? I have following code
mod <- glm(RESPONSE~..., data=training, family=binomial(link="logit"))
summary(mod)
glm$aic
Output:
glmfit$aic Error: object 'glmfit' not found glm.fit$aic Error in glm.fit$aic : object of type 'closure' is not subsettable glm$aic Error in glm$aic : object of type 'closure' is not subsettable aic(glm) Error: could not find function "aic"
Expanding on the correct comment from @rawr.
AIC()
is a function that takes a model object as an argument. In your code example you create a model objectmod
, this needs to be passed to theAIC()
function.