if (FALSE) {
## Count regression comparisons
require(MASS)
house1 <- glm(Freq ~ Infl + Type + Cont, family=poisson, data=housing)
house2 <- glm(Freq ~ Infl + Sat, family=poisson, data=housing)
## CI for BIC
icci(house2, house1)
## Further comparisons to hurdle, zero-inflated models
require(pscl)
bio1 <- glm(art ~ fem + mar + phd + ment, family=poisson, data=bioChemists)
bio2 <- hurdle(art ~ fem + mar + phd + ment, data=bioChemists)
bio3 <- zeroinfl(art ~ fem + mar + phd + ment, data=bioChemists)
icci(bio2, bio1)
icci(bio3, bio1)
icci(bio3, bio2)
## Latent variable model comparisons
require(lavaan)
HS.model <- 'visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit1 <- cfa(HS.model, data=HolzingerSwineford1939, meanstructure=TRUE)
fit2 <- cfa(HS.model, data=HolzingerSwineford1939, group="school")
icci(fit1, fit2)
}
Run the code above in your browser using DataLab