example_df <- data.frame(
ID = rep(1:100, each = 4),
price = rep(c(10, 10, 20, 20), 100),
quality = rep(c(1, 2, 1, 2), 100)
)
beta <- list(
bprice = -0.2,
bquality = 0.8
)
ut <- list(
u1 = list(
v1 = V.1 ~ bprice * price + bquality * quality,
v2 = V.2 ~ 0
)
)
simulate_choices(example_df, ut, setspp = 4, bcoeff = beta)
Run the code above in your browser using DataLab