diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 83b53571..e6cdb8ab 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,4 @@ Version: 1.1.1 -Date: 2023-09-24 18:50:26 UTC -SHA: 92fef03dfe3c81e152eac1387dd1426cb87e3a85 +Date: 2023-09-27 15:04:38 UTC +SHA: + b18d9a6eb951df2e33ecc79370948817cf4993e8 diff --git a/NEWS.md b/NEWS.md index f4b612ad..dc736f70 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ # logitr 1.1.1 - Updated the `convergence.Rmd` vignette to not run any actual code using other packages to fix issue on CRAN where not all packages are available on all platforms. Now the results are hard-coded in place. +- Fixed bug in `makeObsID()` where `table()` was sorting the results stored in `reps`, which has to be manually undone. Fixes #50. # logitr 1.1.0 @@ -310,8 +311,6 @@ bestModel for the WTP calculations, but not the logLik value. Now it's getting the right logLik value too. - Fixed a bug with the scaling option where it was blowing up to use scaling numbers. - - # logitr 0.0.1 Full reboot of logitr! diff --git a/R/modelInputs.R b/R/modelInputs.R index 2d9e51a3..a43e43ba 100644 --- a/R/modelInputs.R +++ b/R/modelInputs.R @@ -211,6 +211,17 @@ makeObsID <- function(data, inputs, outcome) { obsID <- as.vector(as.matrix(data[inputs$obsID])) # Make sure obsID is in sequential order with no repeated IDs reps <- table(obsID) + # table sorts outcome with no way of not sorting, so have to reorder it 🤦 + # see this SO post: + # https://stackoverflow.com/questions/24842157/is-there-a-way-stop-table-from-sorting-in-r + idOrder <- as.character(unique(obsID)) + repsOrder <- names(reps) + finalOrder <- rep(NA, length(idOrder)) + for (i in 1:length(finalOrder)) { + finalOrder[i] <- which(repsOrder == idOrder[i]) + } + reps <- reps[finalOrder] + # Now check if there are repeat errors checkRepeatedIDs('obsID', obsID, reps) # Make sure that each observation ID has only one outcome outcomeCheck <- tapply(outcome, obsID, function(x) sum(x)) diff --git a/inst/example/examples.R b/inst/example/examples.R index 4815c5bf..6cdb501b 100644 --- a/inst/example/examples.R +++ b/inst/example/examples.R @@ -69,333 +69,331 @@ mxl_pref_cor <- logitr( numCores = numCores ) -# Convergence vignette - -# Set the starting parameters for each package as well as the -# number of draws to use for the simulated log-likelihood -numDraws_wtp <- 50 -start_wtp <- c( - scalePar = 1, - feat = 0, - brandhiland = 0, - brandweight = 0, - brandyoplait = 0, - sd_feat = 0.1, - sd_brandhiland = 0.1, - sd_brandweight = 0.1, - sd_brandyoplait = 0.1 -) - - -# Take only half of the yogurt data to speed things up: -yogurt <- subset(logitr::yogurt, logitr::yogurt$id <= 50) - -# Model preparation - -# Several of the pacakges require hand-specifying many settings and -# reformatting the data. These settings are provided here. - -## Prep for {gmnl} - -# Convert the yogurt data for mlogit and gmnl using dfidx function -data_gmnl <- mlogit.data( - data = yogurt, - shape = "long", - choice = "choice", - id.var = 'id', - alt.var = 'alt', - chid.var = 'obsID' -) - -# {apollo} settings - -# Format the `yogurt` data to a "wide" format for {apollo} -yogurt_price <- yogurt %>% - select(id, obsID, price, brand) %>% - mutate(price = -1*price) %>% - pivot_wider( - names_from = 'brand', - values_from = 'price') %>% - rename( - price_dannon = dannon, - price_hiland = hiland, - price_weight = weight, - price_yoplait = yoplait) -yogurt_feat <- yogurt %>% - select(id, obsID, feat, brand) %>% - pivot_wider( - names_from = 'brand', - values_from = 'feat') %>% - rename( - feat_dannon = dannon, - feat_hiland = hiland, - feat_weight = weight, - feat_yoplait = yoplait) -yogurt_choice <- yogurt %>% - filter(choice == 1) %>% - select(id, obsID, choice = alt) -data_apollo <- yogurt_price %>% - left_join(yogurt_feat, by = c('id', 'obsID')) %>% - left_join(yogurt_choice, by = c('id', 'obsID')) %>% - arrange(id, obsID) %>% - mutate( - av_dannon = 1, - av_hiland = 1, - av_weight = 1, - av_yoplait = 1 - ) - -# Define the {apollo} probabilities function -apollo_probabilities_wtp <- function( - apollo_beta, apollo_inputs, functionality = "estimate" -) { - - ### Attach inputs and detach after function exit - apollo_attach(apollo_beta, apollo_inputs) - on.exit(apollo_detach(apollo_beta, apollo_inputs)) - - ### Create list of probabilities P - P <- list() - - ### List of utilities: these must use the same names as in mnl_settings, - # order is irrelevant - V <- list() - V[["dannon"]] <- scalePar * (b_feat * feat_dannon - price_dannon) - V[["hiland"]] <- scalePar * (b_brandhiland + b_feat * feat_hiland - price_hiland) - V[["weight"]] <- scalePar * (b_brandweight + b_feat * feat_weight - price_weight) - V[["yoplait"]] <- scalePar * (b_brandyoplait + b_feat * feat_yoplait - price_yoplait) - - ### Define settings for MNL model component - mnl_settings <- list( - alternatives = c(dannon = 1, hiland = 2, weight = 3, yoplait = 4), - avail = list( - dannon = av_dannon, - hiland = av_hiland, - weight = av_weight, - yoplait = av_yoplait), - choiceVar = choice, - utilities = V - ) - - ### Compute probabilities using MNL model - P[["model"]] <- apollo_mnl(mnl_settings, functionality) - ### Take product across observation for same individual - P <- apollo_panelProd(P, apollo_inputs, functionality) - ### Average across inter-individual draws - P = apollo_avgInterDraws(P, apollo_inputs, functionality) - ### Prepare and return outputs of function - P <- apollo_prepareProb(P, apollo_inputs, functionality) - - return(P) -} - -# Define random parameters function -apollo_randCoeff <- function(apollo_beta, apollo_inputs) { - randcoeff <- list() - randcoeff[['b_feat']] <- feat + d_feat * sd_feat - randcoeff[['b_brandhiland']] <- brandhiland + d_brandhiland * sd_brandhiland - randcoeff[['b_brandweight']] <- brandweight + d_brandweight * sd_brandweight - randcoeff[['b_brandyoplait']] <- brandyoplait + d_brandyoplait * sd_brandyoplait - return(randcoeff) -} - -# Main control settings -apollo_control_wtp <- list( - modelName = "MXL_WTP_space", - modelDescr = "MXL model on yogurt choice SP data, in WTP space", - indivID = "id", - mixing = TRUE, - analyticGrad = TRUE, - panelData = TRUE, - nCores = 1 -) - -# Set parameters for generating draws -apollo_draws_n <- list( - interDrawsType = "halton", - interNDraws = numDraws_wtp, - interUnifDraws = c(), - interNormDraws = c( - "d_feat", "d_brandhiland", "d_brandweight", "d_brandyoplait"), - intraDrawsType = "halton", - intraNDraws = 0, - intraUnifDraws = c(), - intraNormDraws = c() -) - -# Set input -apollo_inputs_wtp <- apollo_validateInputs( - apollo_beta = start_wtp, - apollo_fixed = NULL, - database = data_apollo, - apollo_draws = apollo_draws_n, - apollo_randCoeff = apollo_randCoeff, - apollo_control = apollo_control_wtp -) - -## {mixl} settings - -# Format the `yogurt` data to a "wide" format for {mixl} -data_mixl <- data_apollo # Uses the same "wide" format as {apollo} -data_mixl$ID <- data_mixl$id -data_mixl$CHOICE <- data_mixl$choice - -# Define the {mixl} utility function -mixl_wtp <- " - feat_RND = @feat + draw_1 * @sd_feat; - brandhiland_RND = @brandhiland + draw_2 * @sd_brandhiland; - brandweight_RND = @brandweight + draw_3 * @sd_brandweight; - brandyoplait_RND = @brandyoplait + draw_4 * @sd_brandyoplait; - U_1 = @scalePar * (feat_RND * $feat_dannon - $price_dannon); - U_2 = @scalePar * (brandhiland_RND + feat_RND * $feat_hiland - $price_hiland); - U_3 = @scalePar * (brandweight_RND + feat_RND * $feat_weight - $price_weight); - U_4 = @scalePar * (brandyoplait_RND + feat_RND * $feat_yoplait - $price_yoplait); -" -mixl_spec_wtp <- specify_model(mixl_wtp, data_mixl) -availabilities <- generate_default_availabilities(data_mixl, 4) - -# Estimate WTP space models ---- - -# The same model is now estimated using all five packages. - -## {logitr} - -model_logitr <- logitr( - data = yogurt, - outcome = 'choice', - obsID = 'obsID', - panelID = 'id', - pars = c('feat', 'brand'), - scalePar = 'price', - randPars = c(feat = "n", brand = "n"), - startVals = start_wtp, - numDraws = numDraws_wtp, - numCores = numCores -) - -# {logitr} converges, even without running a multi-start -summary(model_logitr) - -# Including a multi-start helps build confidence in the solution reached: -model_logitr10 <- logitr( - data = yogurt, - outcome = 'choice', - obsID = 'obsID', - panelID = 'id', - pars = c('feat', 'brand'), - scalePar = 'price', - randPars = c(feat = "n", brand = "n"), - startVals = start_wtp, - numDraws = numDraws_wtp, - numMultiStarts = 10, - numCores = numCores -) -summary(model_logitr10) - -## {mixl} - -# First attempt using same starting points as {logitr} -model_mixl1 <- estimate( - mixl_spec_wtp, start_wtp, - data_mixl, availabilities, - nDraws = numDraws_wtp -) - -# {mixl} converges to a local minimum: -c(logLik(model_logitr), logLik(model_mixl1)) -cbind(coef(model_logitr), coef(model_mixl1)) - -# Second attempt using {logitr} solution as starting points -model_mixl2 <- estimate( - mixl_spec_wtp, coef(model_logitr), - data_mixl, availabilities, - nDraws = numDraws_wtp -) - -# Again, {mixl} converges to a local minimum: -c(logLik(model_logitr), logLik(model_mixl2)) -cbind(coef(model_logitr), coef(model_mixl2)) - -## {gmnl} - -# First attempt using same starting points as {logitr}. -# Note that additional starting parameters must be added as the {gmnl} -# approach to estimating WTP is a slightly different model. -model_gmnl1 <- gmnl( - data = data_gmnl, - formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, - ranp = c( - feat = "n", brandhiland = "n", brandweight = "n", - brandyoplait = "n"), - fixed = c(TRUE, rep(FALSE, 10), TRUE), - model = "gmnl", - method = "bfgs", - haltons = NA, - panel = TRUE, - start = c(start_wtp, 0.1, 0.1, 0), - R = numDraws_wtp -) - -# {gmnl} converges to a local minimum: -c(logLik(model_logitr), logLik(model_gmnl1)) -cbind(coef(model_logitr), coef(model_gmnl1)) - -# Second attempt using {logitr} solution as starting points: -model_gmnl2 <- gmnl( - data = data_gmnl, - formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, - ranp = c( - feat = "n", brandhiland = "n", brandweight = "n", - brandyoplait = "n"), - fixed = c(TRUE, rep(FALSE, 10), TRUE), - model = "gmnl", - method = "bfgs", - haltons = NA, - panel = TRUE, - start = c(round(coef(model_logitr), 2), 0.1, 0.1, 0), - R = numDraws_wtp -) - -# This approach errors - -## {apollo} - -# First attempt using same starting points as {logitr}: -model_apollo1 <- apollo_estimate( - apollo_beta = start_wtp, - apollo_fixed = NULL, - apollo_probabilities = apollo_probabilities_wtp, - apollo_inputs = apollo_inputs_wtp, - estimate_settings = list(printLevel = 0) -) - -# {apollo} converges to a local minimum: -c(logLik(model_logitr), logLik(model_apollo1)) -cbind(coef(model_logitr), coef(model_apollo1)) - -# Second attempt using {logitr} solution as starting points: -model_apollo2 <- apollo_estimate( - apollo_beta = coef(model_logitr), - apollo_fixed = NULL, - apollo_probabilities = apollo_probabilities_wtp, - apollo_inputs = apollo_inputs_wtp, - estimate_settings = list(printLevel = 0) -) - -# Again, {apollo} converges to a local minimum: -c(logLik(model_logitr), logLik(model_apollo2)) -cbind(coef(model_logitr), coef(model_apollo2)) - - +# # Convergence vignette +# +# # Set the starting parameters for each package as well as the +# # number of draws to use for the simulated log-likelihood +# numDraws_wtp <- 50 +# start_wtp <- c( +# scalePar = 1, +# feat = 0, +# brandhiland = 0, +# brandweight = 0, +# brandyoplait = 0, +# sd_feat = 0.1, +# sd_brandhiland = 0.1, +# sd_brandweight = 0.1, +# sd_brandyoplait = 0.1 +# ) +# +# +# # Take only half of the yogurt data to speed things up: +# yogurt <- subset(logitr::yogurt, logitr::yogurt$id <= 50) +# +# # Model preparation +# +# # Several of the pacakges require hand-specifying many settings and +# # reformatting the data. These settings are provided here. +# +# ## Prep for {gmnl} +# +# # Convert the yogurt data for mlogit and gmnl using dfidx function +# data_gmnl <- mlogit.data( +# data = yogurt, +# shape = "long", +# choice = "choice", +# id.var = 'id', +# alt.var = 'alt', +# chid.var = 'obsID' +# ) +# +# # {apollo} settings +# +# # Format the `yogurt` data to a "wide" format for {apollo} +# yogurt_price <- yogurt %>% +# select(id, obsID, price, brand) %>% +# mutate(price = -1*price) %>% +# pivot_wider( +# names_from = 'brand', +# values_from = 'price') %>% +# rename( +# price_dannon = dannon, +# price_hiland = hiland, +# price_weight = weight, +# price_yoplait = yoplait) +# yogurt_feat <- yogurt %>% +# select(id, obsID, feat, brand) %>% +# pivot_wider( +# names_from = 'brand', +# values_from = 'feat') %>% +# rename( +# feat_dannon = dannon, +# feat_hiland = hiland, +# feat_weight = weight, +# feat_yoplait = yoplait) +# yogurt_choice <- yogurt %>% +# filter(choice == 1) %>% +# select(id, obsID, choice = alt) +# data_apollo <- yogurt_price %>% +# left_join(yogurt_feat, by = c('id', 'obsID')) %>% +# left_join(yogurt_choice, by = c('id', 'obsID')) %>% +# arrange(id, obsID) %>% +# mutate( +# av_dannon = 1, +# av_hiland = 1, +# av_weight = 1, +# av_yoplait = 1 +# ) +# +# # Define the {apollo} probabilities function +# apollo_probabilities_wtp <- function( +# apollo_beta, apollo_inputs, functionality = "estimate" +# ) { +# +# ### Attach inputs and detach after function exit +# apollo_attach(apollo_beta, apollo_inputs) +# on.exit(apollo_detach(apollo_beta, apollo_inputs)) +# +# ### Create list of probabilities P +# P <- list() +# +# ### List of utilities: these must use the same names as in mnl_settings, +# # order is irrelevant +# V <- list() +# V[["dannon"]] <- scalePar * (b_feat * feat_dannon - price_dannon) +# V[["hiland"]] <- scalePar * (b_brandhiland + b_feat * feat_hiland - price_hiland) +# V[["weight"]] <- scalePar * (b_brandweight + b_feat * feat_weight - price_weight) +# V[["yoplait"]] <- scalePar * (b_brandyoplait + b_feat * feat_yoplait - price_yoplait) +# +# ### Define settings for MNL model component +# mnl_settings <- list( +# alternatives = c(dannon = 1, hiland = 2, weight = 3, yoplait = 4), +# avail = list( +# dannon = av_dannon, +# hiland = av_hiland, +# weight = av_weight, +# yoplait = av_yoplait), +# choiceVar = choice, +# utilities = V +# ) +# +# ### Compute probabilities using MNL model +# P[["model"]] <- apollo_mnl(mnl_settings, functionality) +# ### Take product across observation for same individual +# P <- apollo_panelProd(P, apollo_inputs, functionality) +# ### Average across inter-individual draws +# P = apollo_avgInterDraws(P, apollo_inputs, functionality) +# ### Prepare and return outputs of function +# P <- apollo_prepareProb(P, apollo_inputs, functionality) +# +# return(P) +# } +# +# # Define random parameters function +# apollo_randCoeff <- function(apollo_beta, apollo_inputs) { +# randcoeff <- list() +# randcoeff[['b_feat']] <- feat + d_feat * sd_feat +# randcoeff[['b_brandhiland']] <- brandhiland + d_brandhiland * sd_brandhiland +# randcoeff[['b_brandweight']] <- brandweight + d_brandweight * sd_brandweight +# randcoeff[['b_brandyoplait']] <- brandyoplait + d_brandyoplait * sd_brandyoplait +# return(randcoeff) +# } +# +# # Main control settings +# apollo_control_wtp <- list( +# modelName = "MXL_WTP_space", +# modelDescr = "MXL model on yogurt choice SP data, in WTP space", +# indivID = "id", +# mixing = TRUE, +# analyticGrad = TRUE, +# panelData = TRUE, +# nCores = 1 +# ) +# +# # Set parameters for generating draws +# apollo_draws_n <- list( +# interDrawsType = "halton", +# interNDraws = numDraws_wtp, +# interUnifDraws = c(), +# interNormDraws = c( +# "d_feat", "d_brandhiland", "d_brandweight", "d_brandyoplait"), +# intraDrawsType = "halton", +# intraNDraws = 0, +# intraUnifDraws = c(), +# intraNormDraws = c() +# ) +# +# # Set input +# apollo_inputs_wtp <- apollo_validateInputs( +# apollo_beta = start_wtp, +# apollo_fixed = NULL, +# database = data_apollo, +# apollo_draws = apollo_draws_n, +# apollo_randCoeff = apollo_randCoeff, +# apollo_control = apollo_control_wtp +# ) +# +# ## {mixl} settings +# +# # Format the `yogurt` data to a "wide" format for {mixl} +# data_mixl <- data_apollo # Uses the same "wide" format as {apollo} +# data_mixl$ID <- data_mixl$id +# data_mixl$CHOICE <- data_mixl$choice +# +# # Define the {mixl} utility function +# mixl_wtp <- " +# feat_RND = @feat + draw_1 * @sd_feat; +# brandhiland_RND = @brandhiland + draw_2 * @sd_brandhiland; +# brandweight_RND = @brandweight + draw_3 * @sd_brandweight; +# brandyoplait_RND = @brandyoplait + draw_4 * @sd_brandyoplait; +# U_1 = @scalePar * (feat_RND * $feat_dannon - $price_dannon); +# U_2 = @scalePar * (brandhiland_RND + feat_RND * $feat_hiland - $price_hiland); +# U_3 = @scalePar * (brandweight_RND + feat_RND * $feat_weight - $price_weight); +# U_4 = @scalePar * (brandyoplait_RND + feat_RND * $feat_yoplait - $price_yoplait); +# " +# mixl_spec_wtp <- specify_model(mixl_wtp, data_mixl) +# availabilities <- generate_default_availabilities(data_mixl, 4) +# +# # Estimate WTP space models ---- +# +# # The same model is now estimated using all five packages. +# +# ## {logitr} +# +# model_logitr <- logitr( +# data = yogurt, +# outcome = 'choice', +# obsID = 'obsID', +# panelID = 'id', +# pars = c('feat', 'brand'), +# scalePar = 'price', +# randPars = c(feat = "n", brand = "n"), +# startVals = start_wtp, +# numDraws = numDraws_wtp, +# numCores = numCores +# ) +# +# # {logitr} converges, even without running a multi-start +# summary(model_logitr) +# +# # Including a multi-start helps build confidence in the solution reached: +# model_logitr10 <- logitr( +# data = yogurt, +# outcome = 'choice', +# obsID = 'obsID', +# panelID = 'id', +# pars = c('feat', 'brand'), +# scalePar = 'price', +# randPars = c(feat = "n", brand = "n"), +# startVals = start_wtp, +# numDraws = numDraws_wtp, +# numMultiStarts = 10, +# numCores = numCores +# ) +# summary(model_logitr10) +# +# ## {mixl} +# +# # First attempt using same starting points as {logitr} +# model_mixl1 <- estimate( +# mixl_spec_wtp, start_wtp, +# data_mixl, availabilities, +# nDraws = numDraws_wtp +# ) +# +# # {mixl} converges to a local minimum: +# c(logLik(model_logitr), logLik(model_mixl1)) +# cbind(coef(model_logitr), coef(model_mixl1)) +# +# # Second attempt using {logitr} solution as starting points +# model_mixl2 <- estimate( +# mixl_spec_wtp, coef(model_logitr), +# data_mixl, availabilities, +# nDraws = numDraws_wtp +# ) +# +# # Again, {mixl} converges to a local minimum: +# c(logLik(model_logitr), logLik(model_mixl2)) +# cbind(coef(model_logitr), coef(model_mixl2)) +# +# ## {gmnl} +# +# # First attempt using same starting points as {logitr}. +# # Note that additional starting parameters must be added as the {gmnl} +# # approach to estimating WTP is a slightly different model. +# model_gmnl1 <- gmnl( +# data = data_gmnl, +# formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, +# ranp = c( +# feat = "n", brandhiland = "n", brandweight = "n", +# brandyoplait = "n"), +# fixed = c(TRUE, rep(FALSE, 10), TRUE), +# model = "gmnl", +# method = "bfgs", +# haltons = NA, +# panel = TRUE, +# start = c(start_wtp, 0.1, 0.1, 0), +# R = numDraws_wtp +# ) +# +# # {gmnl} converges to a local minimum: +# c(logLik(model_logitr), logLik(model_gmnl1)) +# cbind(coef(model_logitr), coef(model_gmnl1)) +# +# # Second attempt using {logitr} solution as starting points: +# model_gmnl2 <- gmnl( +# data = data_gmnl, +# formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, +# ranp = c( +# feat = "n", brandhiland = "n", brandweight = "n", +# brandyoplait = "n"), +# fixed = c(TRUE, rep(FALSE, 10), TRUE), +# model = "gmnl", +# method = "bfgs", +# haltons = NA, +# panel = TRUE, +# start = c(round(coef(model_logitr), 2), 0.1, 0.1, 0), +# R = numDraws_wtp +# ) +# +# # This approach errors +# +# ## {apollo} +# +# # First attempt using same starting points as {logitr}: +# model_apollo1 <- apollo_estimate( +# apollo_beta = start_wtp, +# apollo_fixed = NULL, +# apollo_probabilities = apollo_probabilities_wtp, +# apollo_inputs = apollo_inputs_wtp, +# estimate_settings = list(printLevel = 0) +# ) +# +# # {apollo} converges to a local minimum: +# c(logLik(model_logitr), logLik(model_apollo1)) +# cbind(coef(model_logitr), coef(model_apollo1)) +# +# # Second attempt using {logitr} solution as starting points: +# model_apollo2 <- apollo_estimate( +# apollo_beta = coef(model_logitr), +# apollo_fixed = NULL, +# apollo_probabilities = apollo_probabilities_wtp, +# apollo_inputs = apollo_inputs_wtp, +# estimate_settings = list(printLevel = 0) +# ) +# +# # Again, {apollo} converges to a local minimum: +# c(logLik(model_logitr), logLik(model_apollo2)) +# cbind(coef(model_logitr), coef(model_apollo2)) # Save results from all estimated models ---- saveRDS(mxl_pref, here::here('inst', 'extdata', 'mxl_pref.Rds')) saveRDS(mxl_wtp, here::here('inst', 'extdata', 'mxl_wtp.Rds')) saveRDS(mxl_pref_cor, here::here('inst', 'extdata', 'mxl_pref_cor.Rds')) -saveRDS(model_logitr, here::here('inst', 'extdata', 'model_logitr.Rds')) -saveRDS(model_logitr10, here::here('inst', 'extdata', 'model_logitr10.Rds')) -saveRDS(model_mixl1, here::here('inst', 'extdata', 'model_mixl1.Rds')) -saveRDS(model_mixl2, here::here('inst', 'extdata', 'model_mixl2.Rds')) -saveRDS(model_gmnl1, here::here('inst', 'extdata', 'model_gmnl1.Rds')) -saveRDS(model_apollo1, here::here('inst', 'extdata', 'model_apollo1.Rds')) -saveRDS(model_apollo2, here::here('inst', 'extdata', 'model_apollo2.Rds')) +# saveRDS(model_logitr, here::here('inst', 'extdata', 'model_logitr.Rds')) +# saveRDS(model_logitr10, here::here('inst', 'extdata', 'model_logitr10.Rds')) +# saveRDS(model_mixl1, here::here('inst', 'extdata', 'model_mixl1.Rds')) +# saveRDS(model_mixl2, here::here('inst', 'extdata', 'model_mixl2.Rds')) +# saveRDS(model_gmnl1, here::here('inst', 'extdata', 'model_gmnl1.Rds')) +# saveRDS(model_apollo1, here::here('inst', 'extdata', 'model_apollo1.Rds')) +# saveRDS(model_apollo2, here::here('inst', 'extdata', 'model_apollo2.Rds')) diff --git a/inst/extdata/mxl_pref.Rds b/inst/extdata/mxl_pref.Rds index 0d03ce36..de52d567 100644 Binary files a/inst/extdata/mxl_pref.Rds and b/inst/extdata/mxl_pref.Rds differ diff --git a/inst/extdata/mxl_pref_cor.Rds b/inst/extdata/mxl_pref_cor.Rds index a5f77aae..10525c7b 100644 Binary files a/inst/extdata/mxl_pref_cor.Rds and b/inst/extdata/mxl_pref_cor.Rds differ diff --git a/inst/extdata/mxl_wtp.Rds b/inst/extdata/mxl_wtp.Rds index 73cf7fd3..6d61a5e1 100644 Binary files a/inst/extdata/mxl_wtp.Rds and b/inst/extdata/mxl_wtp.Rds differ