# Aic in GLM

**URL:** <https://discourse.julialang.org/t/aic-in-glm/6229>\
**Category:** New to Julia\
**Tags:** glm\
**Created:** [October 4, 2017, 1:42am UTC](https://discourse.julialang.org/t/aic-in-glm/6229 "2017-10-04T01:42:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [October 4, 2017, 1:42am UTC](https://discourse.julialang.org/t/aic-in-glm/6229/1 "2017-10-04T01:42:33Z")

</div>

Hey everyone,

I am trying to get the AIC of a model in GLM. It’s just a simple regression model with an identity link function. Yet, the call to `aic(mod)` says that my model is not a subtype of StatisticalModel.

Shouldn’t a GLM be a subtype of a StatisticalModel? Is there something I have missed? Do I, perhaps, need to implement a new method for aic?

Many thanks in advance,

Lewis

---

<div class="post-metadata">

**Author:** ![LewisHein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewishein/32/5690_2.png) [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Post date:** [October 7, 2017, 11:22pm UTC](https://discourse.julialang.org/t/aic-in-glm/6229/2 "2017-10-07T23:22:23Z")

</div>

OK, I figured out the problem. I was trying to be all fancy, and take the aic of several models at once as in `aic.((mod1, mod2, mod3))`, but instead wrote `aic(mod1, mod2, mod3)`. My apologies for cluttering up the forum with this pointless question.

---

<div class="post-metadata">

**Author:** ![sidpku](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sidpku/32/45729_2.png) [@sidpku](https://discourse.julialang.org/u/sidpku)\
**Post date:** [April 9, 2024, 3:17am UTC](https://discourse.julialang.org/t/aic-in-glm/6229/3 "2024-04-09T03:17:47Z")

</div>

I am looking for the AIC function in Julia that can play with `GLM.jl`. Your question has helped me. In case someone encounter the same issue, I want to adding that the AIC function is in `StatsBase.jl`.
