I have two linear models created with lm
that I would like to compare with a table in the stargazer
package. For the most part, I like the results I'm getting. But the Akaike Information Criterion is not showing. The docs say I can pass "aic"
in the keep.stat
argument to include it. But it's not there. No error messages.
stargazer(model1, model2, type="text", report="vc", header=FALSE,
title="Linear Models Predicting Forest Land",
keep.stat=c("aic", "rsq", "n"), omit.table.layout="n")
Linear Models Predicting Forest Land
==========================================
Dependent variable:
--------------------
forest
(1) (2)
------------------------------------------
log.MS.MIL.XPND.GD.ZS -11.948 -12.557
log.TX.VAL.AGRI.ZS.UN 2.310 2.299
log.NY.GDP.MKTP.CD 0.505
Constant 40.857 28.365
------------------------------------------
Observations 183 183
R2 0.142 0.146
==========================================
I don't see any reason why it wouldn't be able to include it. Calling the global AIC
function on these models works fine.
> AIC(model1)
[1] 1586.17
> AIC(model2)
[1] 1587.208