lbinary <- logits(AB_CD = dichotomy(c("A", "B"), c("C", "D")),
A_B = dichotomy("A", "B"),
C_D = dichotomy("C", "D"))
as.matrix(lbinary)
health.nested <- nestedLogit(product4 ~ age + gender * household + position_level,
dichotomies = lbinary, data = HealthInsurance)
car::Anova(health.nested)
coef(health.nested)
Run the code above in your browser using DataLab