HealthInsurance | R Documentation |
A company recently introduced a new health insurance provider for its employees. At the beginning of the year the employees had to choose one of three (or four) different health plan products from this provider to best suit their needs.
This dataset was modified from its original source (McNulty, 2022) for the present purposes by adding a fourth choice, sampled randomly from the original three.
data("HealthInsurance", package = "nestedLogit")
A data frame with 1448 rows and 7 columns.
Choice among three products, a factor with levels "A"
, "B"
,
and "C"
.
Choice among four products, a factor with levels "A"
, "B"
,
"C"
, and "D"
.
The age of the individual, in years.
The number of people living with the individual in the same household.
Position level in the company at the time the choice was made, where 1 is is the lowest level and 5 is the highest, a numeric vector.
The gender of the individual, a factor with levels "Female"
and "Male"
.
The number of days the individual was absent from work in the year prior to the choice,
Originally taken from McNulty, K. (2022). Handbook of Regression Modeling in People Analytics, https://peopleanalytics-regression-book.org/data/health_insurance.csv.
nestedLogit
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.