# NOT RUN {
data(Hotel_Long)
# Before using the rmm function, the user must first use the rmm_shape function.
rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID",
alts="Room_Type", asv="Price", resp="Purchase", min_obs=30)
# Fitting a model
rst_rmm <- rmm(rst_reshape, prop=0.7, model="cl")
# Predictions
Rem_Choice_Set <- rst_reshape$Rem_Choice_Set
newdata1 <- data.frame(Price_1=c(232, 122, 524), Price_3=c(152, 531, 221),
Price_4=c(163, 743, 192), Price_5=c(132, 535, 325),
Price_7=c(136, 276, 673), Price_8=c(387, 153, 454),
Price_9=c(262, 163, 326), Price_10=c(421, 573, 472))
predict(rst_rmm, newdata=newdata1, Rem_Choice_Set=Rem_Choice_Set,
Choice_Set_Code=3, fixed=TRUE)
newdata2 <- data.frame(Price_1=c(521, 321, 101, 234, 743),
Price_5=c(677, 412, 98, 321, 382),
Price_8=c(232, 384, 330, 590, 280))
predict(rst_rmm, newdata=newdata2, Rem_Choice_Set=Rem_Choice_Set,
Choice_Set_Code=7, fixed=FALSE)
# }
Run the code above in your browser using DataLab