AnovaFixedEffectModels
using AnovaFixedEffectModels
AnovaFixedEffectModels.jl
supports FixedEffectModels
.
lfe
is as same as reg
, but the order of arguments is closer to other modeling packages.
fem1 = lfe(@formula(gpa ~ fe(student) + occasion + job), gpa)
aovf = anova(fem1)
Analysis of Variance
Type 1 test / F test
gpa ~ :(fe(student)) + occasion + job
Table:
──────────────────────────────────────────────────────────
DOF Exp.SS Mean Square F value Pr(>|F|)
──────────────────────────────────────────────────────────
occasion 1 39.56 39.56 717.6351 <1e-99
job 2 3.0710 1.5355 27.8545 <1e-11
(Residuals) 997 54.96 0.0551
──────────────────────────────────────────────────────────
Likelihood-ratio test is available for nested models.
fems = nestedmodels(FixedEffectModel, @formula(gpa ~ fe(student) + occasion + job), gpa)
anova(LRT, fems)
Analysis of Variance
Type 1 test / Likelihood-ratio test
Model 1: gpa ~ 0 + :(fe(student))
Model 2: gpa ~ occasion + :(fe(student))
Model 3: gpa ~ :(fe(student)) + occasion + job
Table:
───────────────────────────────────────────────────
DOF ΔDOF Res.DOF Deviance χ² Pr(>|χ²|)
───────────────────────────────────────────────────
1 199 1001 97.59
2 201 2 999 58.03 39.5595 <1e-08
3 203 2 997 54.96 3.0710 0.2154
───────────────────────────────────────────────────