data(Reinis)
str(Reinis)
ftable(Reinis, row.vars = 1:3)
# Fit all 0-way through 6-way models using Kway()
Reinis.gmodels <- Kway(Freq ~ smoke + mental + phys + systol + protein + family,
data = Reinis, family = poisson)
# Examine fit statistics
LRstats(Reinis.gmodels)
# Sequential tests for k vs k+1 way effects
anova(Reinis.gmodels, test = "Chisq")
# Fit sequential models of joint independence
Reinis.seqjoint <- seq_loglm(Reinis, type = "joint", prefix="joint")
LRstats(Reinis.seqjoint)
# Fit sequential models of conditional independence
Reinis.seqcond <- seq_loglm(Reinis, type = "conditional", prefix = "cond")
LRstats(Reinis.seqcond)
Run the code above in your browser using DataLab