Model run by stephane.hess using Apollo 0.3.6 on R 4.5.1 for Darwin. Please acknowledge the use of Apollo by citing Hess & Palma (2019) DOI 10.1016/j.jocm.2019.100170 www.ApolloChoiceModelling.com Model name : BW_simultaneous Model description : Best-worst model on drug choice data, simultaneous choice Model run at : 2025-09-19 11:47:22.389255 Estimation method : bgw Estimation diagnosis : Relative function convergence Optimisation diagnosis : Maximum found hessian properties : Negative definite maximum eigenvalue : -173.742913 reciprocal of condition number : 1.23081e-07 Number of individuals : 1000 Number of rows in database : 10000 Number of modelled outcomes : 10000 Number of cores used : 1 Model without mixing LL(start) : -24849.07 LL at equal shares, LL(0) : -24849.07 LL at observed shares, LL(C) : -23674.01 LL(final) : -20798.29 Rho-squared vs equal shares : 0.163 Adj.Rho-squared vs equal shares : 0.1625 Rho-squared vs observed shares : 0.1215 Adj.Rho-squared vs observed shares : 0.1213 AIC : 41624.58 BIC : 41725.52 Estimated parameters : 14 Time taken (hh:mm:ss) : 00:00:7.12 pre-estimation : 00:00:2.3 estimation : 00:00:0.82 post-estimation : 00:00:4 Iterations : 8 Unconstrained optimisation. Estimates: Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0) b_brand_Artemis 0.000000 NA NA NA NA b_brand_Novum -0.255552 0.02338 -10.930 0.02333 -10.954 b_brand_BestValue -0.471454 0.04180 -11.279 0.04341 -10.859 b_brand_Supermarket -0.247412 0.04305 -5.747 0.04685 -5.281 b_brand_PainAway -0.967195 0.04421 -21.875 0.04640 -20.844 b_country_CH 0.512735 0.03057 16.773 0.03006 17.059 b_country_DK 0.249927 0.02875 8.693 0.02818 8.869 b_country_USA 0.000000 NA NA NA NA b_country_IND -0.204755 0.03598 -5.691 0.03687 -5.554 b_country_RUS -0.683723 0.03816 -17.917 0.03832 -17.841 b_country_BRA -0.483124 0.03726 -12.967 0.03838 -12.586 b_char_standard 0.000000 NA NA NA NA b_char_fast 0.602543 0.02158 27.916 0.02150 28.031 b_char_double 0.968351 0.03013 32.141 0.02907 33.312 b_risk -0.001234 4.062e-05 -30.385 4.096e-05 -30.130 b_price -0.600705 0.01469 -40.902 0.01391 -43.171 mu_worst 0.814954 0.02726 29.895 0.02677 30.446 Overview of choices for MNL model component : alt_b1_w2 alt_b1_w3 alt_b1_w4 alt_b2_w1 alt_b2_w3 alt_b2_w4 Times available 10000.00 10000.00 10000.00 10000.0 10000.00 10000.00 Times chosen 698.00 1358.00 1347.00 680.0 1447.00 1419.00 Percentage chosen overall 6.98 13.58 13.47 6.8 14.47 14.19 Percentage chosen when available 6.98 13.58 13.47 6.8 14.47 14.19 alt_b3_w1 alt_b3_w2 alt_b3_w4 alt_b4_w1 alt_b4_w2 alt_b4_w3 Times available 10000.0 10000.00 10000.00 10000.00 10000.00 10000.00 Times chosen 410.0 431.00 676.00 441.00 416.00 677.00 Percentage chosen overall 4.1 4.31 6.76 4.41 4.16 6.77 Percentage chosen when available 4.1 4.31 6.76 4.41 4.16 6.77 Classical covariance matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_Novum 5.4667e-04 2.9126e-04 3.2418e-04 b_brand_BestValue 2.9126e-04 0.001747 0.001323 b_brand_Supermarket 3.2418e-04 0.001323 0.001853 b_brand_PainAway 3.2001e-04 0.001286 0.001259 b_country_CH -4.732e-05 3.8441e-04 4.2148e-04 b_country_DK -4.212e-05 3.7203e-04 4.0507e-04 b_country_IND -1.458e-05 -6.0243e-04 -6.4243e-04 b_country_RUS 5.153e-06 -5.7714e-04 -6.5204e-04 b_country_BRA 1.173e-05 -5.5648e-04 -6.6922e-04 b_char_fast -9.673e-06 -3.202e-07 6.500e-05 b_char_double 3.448e-05 2.0442e-04 2.8547e-04 b_risk 4.152e-08 -1.857e-07 -3.355e-07 b_price 3.542e-05 1.8062e-04 1.3789e-04 mu_worst 2.582e-05 1.491e-05 -1.0963e-04 b_brand_PainAway b_country_CH b_country_DK b_brand_Novum 3.2001e-04 -4.732e-05 -4.212e-05 b_brand_BestValue 0.001286 3.8441e-04 3.7203e-04 b_brand_Supermarket 0.001259 4.2148e-04 4.0507e-04 b_brand_PainAway 0.001955 2.7665e-04 3.2281e-04 b_country_CH 2.7665e-04 9.3447e-04 4.3415e-04 b_country_DK 3.2281e-04 4.3415e-04 8.2667e-04 b_country_IND -5.3776e-04 -6.137e-05 5.080e-06 b_country_RUS -3.9892e-04 -1.3004e-04 -5.206e-05 b_country_BRA -4.6714e-04 -1.2374e-04 -6.808e-05 b_char_fast -1.5993e-04 1.1482e-04 6.653e-05 b_char_double 3.116e-05 1.3001e-04 5.294e-05 b_risk 2.510e-07 -2.227e-07 -1.201e-07 b_price 2.8668e-04 -9.934e-05 -3.922e-05 mu_worst 3.3588e-04 -1.7274e-04 -9.367e-05 b_country_IND b_country_RUS b_country_BRA b_brand_Novum -1.458e-05 5.153e-06 1.173e-05 b_brand_BestValue -6.0243e-04 -5.7714e-04 -5.5648e-04 b_brand_Supermarket -6.4243e-04 -6.5204e-04 -6.6922e-04 b_brand_PainAway -5.3776e-04 -3.9892e-04 -4.6714e-04 b_country_CH -6.137e-05 -1.3004e-04 -1.2374e-04 b_country_DK 5.080e-06 -5.206e-05 -6.808e-05 b_country_IND 0.001295 6.8530e-04 6.9326e-04 b_country_RUS 6.8530e-04 0.001456 7.4920e-04 b_country_BRA 6.9326e-04 7.4920e-04 0.001388 b_char_fast -8.706e-05 -1.8230e-04 -1.3130e-04 b_char_double -8.139e-05 -1.9247e-04 -1.4599e-04 b_risk 1.400e-07 4.221e-07 2.432e-07 b_price 5.709e-05 1.3649e-04 1.1366e-04 mu_worst 1.3168e-04 3.5613e-04 2.3634e-04 b_char_fast b_char_double b_risk b_brand_Novum -9.673e-06 3.448e-05 4.152e-08 b_brand_BestValue -3.202e-07 2.0442e-04 -1.857e-07 b_brand_Supermarket 6.500e-05 2.8547e-04 -3.355e-07 b_brand_PainAway -1.5993e-04 3.116e-05 2.510e-07 b_country_CH 1.1482e-04 1.3001e-04 -2.227e-07 b_country_DK 6.653e-05 5.294e-05 -1.201e-07 b_country_IND -8.706e-05 -8.139e-05 1.400e-07 b_country_RUS -1.8230e-04 -1.9247e-04 4.221e-07 b_country_BRA -1.3130e-04 -1.4599e-04 2.432e-07 b_char_fast 4.6589e-04 3.1378e-04 -2.965e-07 b_char_double 3.1378e-04 9.0771e-04 -3.552e-07 b_risk -2.965e-07 -3.552e-07 1.650e-09 b_price -1.1130e-04 -1.3803e-04 2.737e-07 mu_worst -2.4220e-04 -2.9209e-04 7.285e-07 b_price mu_worst b_brand_Novum 3.542e-05 2.582e-05 b_brand_BestValue 1.8062e-04 1.491e-05 b_brand_Supermarket 1.3789e-04 -1.0963e-04 b_brand_PainAway 2.8668e-04 3.3588e-04 b_country_CH -9.934e-05 -1.7274e-04 b_country_DK -3.922e-05 -9.367e-05 b_country_IND 5.709e-05 1.3168e-04 b_country_RUS 1.3649e-04 3.5613e-04 b_country_BRA 1.1366e-04 2.3634e-04 b_char_fast -1.1130e-04 -2.4220e-04 b_char_double -1.3803e-04 -2.9209e-04 b_risk 2.737e-07 7.285e-07 b_price 2.1569e-04 1.9962e-04 mu_worst 1.9962e-04 7.4315e-04 Robust covariance matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_Novum 5.4423e-04 2.4681e-04 3.0185e-04 b_brand_BestValue 2.4681e-04 0.001885 0.001519 b_brand_Supermarket 3.0185e-04 0.001519 0.002195 b_brand_PainAway 2.9562e-04 0.001450 0.001476 b_country_CH -9.090e-05 2.9336e-04 3.5033e-04 b_country_DK -6.104e-05 2.5719e-04 3.1550e-04 b_country_IND 4.582e-06 -6.2399e-04 -6.8272e-04 b_country_RUS 3.308e-05 -6.0577e-04 -7.0549e-04 b_country_BRA 5.868e-05 -6.0410e-04 -7.4103e-04 b_char_fast -4.705e-05 -1.938e-05 7.656e-05 b_char_double -1.852e-05 1.2345e-04 2.4366e-04 b_risk 6.336e-08 -1.719e-07 -3.575e-07 b_price 4.691e-05 1.5948e-04 1.0410e-04 mu_worst 6.331e-05 2.163e-06 -1.3726e-04 b_brand_PainAway b_country_CH b_country_DK b_brand_Novum 2.9562e-04 -9.090e-05 -6.104e-05 b_brand_BestValue 0.001450 2.9336e-04 2.5719e-04 b_brand_Supermarket 0.001476 3.5033e-04 3.1550e-04 b_brand_PainAway 0.002153 2.0308e-04 2.4748e-04 b_country_CH 2.0308e-04 9.0339e-04 4.0180e-04 b_country_DK 2.4748e-04 4.0180e-04 7.9409e-04 b_country_IND -5.0711e-04 -6.961e-05 4.648e-06 b_country_RUS -4.0671e-04 -1.6583e-04 -5.430e-05 b_country_BRA -4.6706e-04 -1.4141e-04 -8.201e-05 b_char_fast -1.6565e-04 1.2314e-04 5.957e-05 b_char_double -4.135e-05 1.2096e-04 3.872e-05 b_risk 2.264e-07 -1.835e-07 -6.434e-08 b_price 2.5779e-04 -9.255e-05 -3.801e-05 mu_worst 3.2551e-04 -1.9395e-04 -1.1197e-04 b_country_IND b_country_RUS b_country_BRA b_brand_Novum 4.582e-06 3.308e-05 5.868e-05 b_brand_BestValue -6.2399e-04 -6.0577e-04 -6.0410e-04 b_brand_Supermarket -6.8272e-04 -7.0549e-04 -7.4103e-04 b_brand_PainAway -5.0711e-04 -4.0671e-04 -4.6706e-04 b_country_CH -6.961e-05 -1.6583e-04 -1.4141e-04 b_country_DK 4.648e-06 -5.430e-05 -8.201e-05 b_country_IND 0.001359 6.8585e-04 7.4848e-04 b_country_RUS 6.8585e-04 0.001469 8.4269e-04 b_country_BRA 7.4848e-04 8.4269e-04 0.001473 b_char_fast -1.1395e-04 -2.3139e-04 -1.7345e-04 b_char_double -1.3685e-04 -2.3319e-04 -2.1579e-04 b_risk 1.909e-07 4.839e-07 3.084e-07 b_price 7.962e-05 1.5375e-04 1.3308e-04 mu_worst 1.4366e-04 3.6959e-04 2.7436e-04 b_char_fast b_char_double b_risk b_brand_Novum -4.705e-05 -1.852e-05 6.336e-08 b_brand_BestValue -1.938e-05 1.2345e-04 -1.719e-07 b_brand_Supermarket 7.656e-05 2.4366e-04 -3.575e-07 b_brand_PainAway -1.6565e-04 -4.135e-05 2.264e-07 b_country_CH 1.2314e-04 1.2096e-04 -1.835e-07 b_country_DK 5.957e-05 3.872e-05 -6.434e-08 b_country_IND -1.1395e-04 -1.3685e-04 1.909e-07 b_country_RUS -2.3139e-04 -2.3319e-04 4.839e-07 b_country_BRA -1.7345e-04 -2.1579e-04 3.084e-07 b_char_fast 4.6205e-04 3.1168e-04 -2.994e-07 b_char_double 3.1168e-04 8.4502e-04 -3.151e-07 b_risk -2.994e-07 -3.151e-07 1.678e-09 b_price -1.1436e-04 -1.3582e-04 2.604e-07 mu_worst -2.6384e-04 -2.8019e-04 7.357e-07 b_price mu_worst b_brand_Novum 4.691e-05 6.331e-05 b_brand_BestValue 1.5948e-04 2.163e-06 b_brand_Supermarket 1.0410e-04 -1.3726e-04 b_brand_PainAway 2.5779e-04 3.2551e-04 b_country_CH -9.255e-05 -1.9395e-04 b_country_DK -3.801e-05 -1.1197e-04 b_country_IND 7.962e-05 1.4366e-04 b_country_RUS 1.5375e-04 3.6959e-04 b_country_BRA 1.3308e-04 2.7436e-04 b_char_fast -1.1436e-04 -2.6384e-04 b_char_double -1.3582e-04 -2.8019e-04 b_risk 2.604e-07 7.357e-07 b_price 1.9361e-04 1.9710e-04 mu_worst 1.9710e-04 7.1650e-04 Classical correlation matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_Novum 1.000000 0.29802 0.32208 b_brand_BestValue 0.298025 1.00000 0.73498 b_brand_Supermarket 0.322076 0.73498 1.00000 b_brand_PainAway 0.309563 0.69590 0.66164 b_country_CH -0.066200 0.30085 0.32028 b_country_DK -0.062656 0.30957 0.32726 b_country_IND -0.017332 -0.40057 -0.41474 b_country_RUS 0.005776 -0.36182 -0.39690 b_country_BRA 0.013462 -0.35732 -0.41722 b_char_fast -0.019168 -3.5493e-04 0.06995 b_char_double 0.048952 0.16233 0.22010 b_risk 0.043722 -0.10939 -0.19190 b_price 0.103154 0.29424 0.21810 mu_worst 0.040515 0.01308 -0.09341 b_brand_PainAway b_country_CH b_country_DK b_brand_Novum 0.30956 -0.06620 -0.062656 b_brand_BestValue 0.69590 0.30085 0.309568 b_brand_Supermarket 0.66164 0.32028 0.327264 b_brand_PainAway 1.00000 0.20469 0.253936 b_country_CH 0.20469 1.00000 0.493957 b_country_DK 0.25394 0.49396 1.000000 b_country_IND -0.33803 -0.05580 0.004910 b_country_RUS -0.23643 -0.11147 -0.047448 b_country_BRA -0.28357 -0.10864 -0.063550 b_char_fast -0.16758 0.17402 0.107200 b_char_double 0.02339 0.14116 0.061114 b_risk 0.13975 -0.17940 -0.102862 b_price 0.44150 -0.22127 -0.092890 mu_worst 0.27867 -0.20729 -0.119502 b_country_IND b_country_RUS b_country_BRA b_brand_Novum -0.017332 0.005776 0.01346 b_brand_BestValue -0.400569 -0.361822 -0.35732 b_brand_Supermarket -0.414743 -0.396898 -0.41722 b_brand_PainAway -0.338030 -0.236429 -0.28357 b_country_CH -0.055797 -0.111475 -0.10864 b_country_DK 0.004910 -0.047448 -0.06355 b_country_IND 1.000000 0.499094 0.51712 b_country_RUS 0.499094 1.000000 0.52691 b_country_BRA 0.517119 0.526913 1.00000 b_char_fast -0.112102 -0.221322 -0.16327 b_char_double -0.075082 -0.167407 -0.13005 b_risk 0.095793 0.272347 0.16072 b_price 0.108030 0.243542 0.20771 mu_worst 0.134251 0.342332 0.23268 b_char_fast b_char_double b_risk b_brand_Novum -0.01917 0.04895 0.04372 b_brand_BestValue -3.5493e-04 0.16233 -0.10939 b_brand_Supermarket 0.06995 0.22010 -0.19190 b_brand_PainAway -0.16758 0.02339 0.13975 b_country_CH 0.17402 0.14116 -0.17940 b_country_DK 0.10720 0.06111 -0.10286 b_country_IND -0.11210 -0.07508 0.09579 b_country_RUS -0.22132 -0.16741 0.27235 b_country_BRA -0.16327 -0.13005 0.16072 b_char_fast 1.00000 0.48251 -0.33815 b_char_double 0.48251 1.00000 -0.29025 b_risk -0.33815 -0.29025 1.00000 b_price -0.35110 -0.31195 0.45879 mu_worst -0.41162 -0.35564 0.65795 b_price mu_worst b_brand_Novum 0.10315 0.04051 b_brand_BestValue 0.29424 0.01308 b_brand_Supermarket 0.21810 -0.09341 b_brand_PainAway 0.44150 0.27867 b_country_CH -0.22127 -0.20729 b_country_DK -0.09289 -0.11950 b_country_IND 0.10803 0.13425 b_country_RUS 0.24354 0.34233 b_country_BRA 0.20771 0.23268 b_char_fast -0.35110 -0.41162 b_char_double -0.31195 -0.35564 b_risk 0.45879 0.65795 b_price 1.00000 0.49860 mu_worst 0.49860 1.00000 Robust correlation matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_Novum 1.000000 0.243694 0.27619 b_brand_BestValue 0.243694 1.000000 0.74680 b_brand_Supermarket 0.276189 0.746796 1.00000 b_brand_PainAway 0.273097 0.719862 0.67887 b_country_CH -0.129646 0.224813 0.24880 b_country_DK -0.092859 0.210227 0.23898 b_country_IND 0.005327 -0.389839 -0.39526 b_country_RUS 0.037006 -0.364090 -0.39294 b_country_BRA 0.065531 -0.362504 -0.41208 b_char_fast -0.093833 -0.020766 0.07603 b_char_double -0.027305 0.097820 0.17892 b_risk 0.066303 -0.096645 -0.18632 b_price 0.144516 0.264007 0.15970 mu_worst 0.101382 0.001861 -0.10945 b_brand_PainAway b_country_CH b_country_DK b_brand_Novum 0.27310 -0.12965 -0.092859 b_brand_BestValue 0.71986 0.22481 0.210227 b_brand_Supermarket 0.67887 0.24880 0.238981 b_brand_PainAway 1.00000 0.14561 0.189272 b_country_CH 0.14561 1.00000 0.474388 b_country_DK 0.18927 0.47439 1.000000 b_country_IND -0.29643 -0.06281 0.004474 b_country_RUS -0.22871 -0.14396 -0.050282 b_country_BRA -0.26223 -0.12257 -0.075818 b_char_fast -0.16608 0.19059 0.098352 b_char_double -0.03066 0.13844 0.047274 b_risk 0.11914 -0.14903 -0.055737 b_price 0.39928 -0.22129 -0.096946 mu_worst 0.26208 -0.24107 -0.148440 b_country_IND b_country_RUS b_country_BRA b_brand_Novum 0.005327 0.03701 0.06553 b_brand_BestValue -0.389839 -0.36409 -0.36250 b_brand_Supermarket -0.395264 -0.39294 -0.41208 b_brand_PainAway -0.296426 -0.22871 -0.26223 b_country_CH -0.062814 -0.14396 -0.12257 b_country_DK 0.004474 -0.05028 -0.07582 b_country_IND 1.000000 0.48541 0.52889 b_country_RUS 0.485406 1.00000 0.57285 b_country_BRA 0.528886 0.57285 1.00000 b_char_fast -0.143779 -0.28089 -0.21022 b_char_double -0.127688 -0.20932 -0.19339 b_risk 0.126381 0.30826 0.19617 b_price 0.155195 0.28833 0.24916 mu_worst 0.145567 0.36028 0.26703 b_char_fast b_char_double b_risk b_brand_Novum -0.09383 -0.02731 0.06630 b_brand_BestValue -0.02077 0.09782 -0.09665 b_brand_Supermarket 0.07603 0.17892 -0.18632 b_brand_PainAway -0.16608 -0.03066 0.11914 b_country_CH 0.19059 0.13844 -0.14903 b_country_DK 0.09835 0.04727 -0.05574 b_country_IND -0.14378 -0.12769 0.12638 b_country_RUS -0.28089 -0.20932 0.30826 b_country_BRA -0.21022 -0.19339 0.19617 b_char_fast 1.00000 0.49880 -0.34005 b_char_double 0.49880 1.00000 -0.26463 b_risk -0.34005 -0.26463 1.00000 b_price -0.38236 -0.33580 0.45691 mu_worst -0.45855 -0.36010 0.67101 b_price mu_worst b_brand_Novum 0.14452 0.101382 b_brand_BestValue 0.26401 0.001861 b_brand_Supermarket 0.15970 -0.109453 b_brand_PainAway 0.39928 0.262079 b_country_CH -0.22129 -0.241075 b_country_DK -0.09695 -0.148440 b_country_IND 0.15519 0.145567 b_country_RUS 0.28833 0.360283 b_country_BRA 0.24916 0.267027 b_char_fast -0.38236 -0.458547 b_char_double -0.33580 -0.360095 b_risk 0.45691 0.671008 b_price 1.00000 0.529186 mu_worst 0.52919 1.000000 20 most extreme outliers in terms of lowest average per choice prediction: ID Avg prob per choice 875 0.04390965 593 0.04452467 367 0.04898700 859 0.05496920 947 0.05669378 476 0.06004106 8 0.06058929 524 0.06179413 70 0.06206913 611 0.06223153 933 0.06263352 499 0.06342270 288 0.06352687 287 0.06393965 1000 0.06403758 240 0.06415734 584 0.06417908 472 0.06442427 565 0.06458938 969 0.06488128 Settings and functions used in model definition: apollo_control -------------- Value modelDescr "Best-worst model on drug choice data, simultaneous choice" indivID "ID" outputDirectory "output/" debug "FALSE" modelName "BW_simultaneous" nCores "1" workInLogs "FALSE" seed "13" mixing "FALSE" HB "FALSE" noValidation "FALSE" noDiagnostics "FALSE" calculateLLC "TRUE" analyticHessian "FALSE" memorySaver "FALSE" panelData "TRUE" analyticGrad "TRUE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" Hessian routines attempted -------------------------- numerical jacobian of LL analytical gradient Scaling used in computing Hessian --------------------------------- Value b_brand_Novum 0.255551758 b_brand_BestValue 0.471453702 b_brand_Supermarket 0.247411505 b_brand_PainAway 0.967194626 b_country_CH 0.512734895 b_country_DK 0.249926669 b_country_IND 0.204754798 b_country_RUS 0.683723082 b_country_BRA 0.483123996 b_char_fast 0.602542890 b_char_double 0.968351069 b_risk 0.001234138 b_price 0.600704578 mu_worst 0.814953728 apollo_probabilities ---------------------- 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[["alt1"]] = ( b_brand_Artemis*(brand_1=="Artemis") + b_brand_Novum*(brand_1=="Novum") + b_country_CH*(country_1=="Switzerland") + b_country_DK*(country_1=="Denmark") + b_country_USA*(country_1=="USA") + b_char_standard*(char_1=="standard") + b_char_fast*(char_1=="fast acting") + b_char_double*(char_1=="double strength") + b_risk*side_effects_1 + b_price*price_1) V[["alt2"]] = ( b_brand_Artemis*(brand_2=="Artemis") + b_brand_Novum*(brand_2=="Novum") + b_country_CH*(country_2=="Switzerland") + b_country_DK*(country_2=="Denmark") + b_country_USA*(country_2=="USA") + b_char_standard*(char_2=="standard") + b_char_fast*(char_2=="fast acting") + b_char_double*(char_2=="double strength") + b_risk*side_effects_2 + b_price*price_2) V[["alt3"]] = ( b_brand_BestValue*(brand_3=="BestValue") + b_brand_Supermarket*(brand_3=="Supermarket") + b_brand_PainAway*(brand_3=="PainAway") + b_country_USA*(country_3=="USA") + b_country_IND*(country_3=="India") + b_country_RUS*(country_3=="Russia") + b_country_BRA*(country_3=="Brazil") + b_char_standard*(char_3=="standard") + b_char_fast*(char_3=="fast acting") + b_risk*side_effects_3 + b_price*price_3 ) V[["alt4"]] = ( b_brand_BestValue*(brand_4=="BestValue") + b_brand_Supermarket*(brand_4=="Supermarket") + b_brand_PainAway*(brand_4=="PainAway") + b_country_USA*(country_4=="USA") + b_country_IND*(country_4=="India") + b_country_RUS*(country_4=="Russia") + b_country_BRA*(country_4=="Brazil") + b_char_standard*(char_4=="standard") + b_char_fast*(char_4=="fast acting") + b_risk*side_effects_4 + b_price*price_4 ) ### Compute probabilities for "worst" choice using MNL model mnl_settings = list( alternatives = c(alt_b1_w2=12, alt_b1_w3=13, alt_b1_w4=14, alt_b2_w1=21, alt_b2_w3=23, alt_b2_w4=24, alt_b3_w1=31, alt_b3_w2=32, alt_b3_w4=34, alt_b4_w1=41, alt_b4_w2=42, alt_b4_w3=43), choiceVar = 10*best+worst, utilities = list(alt_b1_w2=V[["alt1"]]-mu_worst*V[["alt2"]], alt_b1_w3=V[["alt1"]]-mu_worst*V[["alt3"]], alt_b1_w4=V[["alt1"]]-mu_worst*V[["alt4"]], alt_b2_w1=V[["alt2"]]-mu_worst*V[["alt1"]], alt_b2_w3=V[["alt2"]]-mu_worst*V[["alt3"]], alt_b2_w4=V[["alt2"]]-mu_worst*V[["alt4"]], alt_b3_w1=V[["alt3"]]-mu_worst*V[["alt1"]], alt_b3_w2=V[["alt3"]]-mu_worst*V[["alt2"]], alt_b3_w4=V[["alt3"]]-mu_worst*V[["alt4"]], alt_b4_w1=V[["alt4"]]-mu_worst*V[["alt1"]], alt_b4_w2=V[["alt4"]]-mu_worst*V[["alt2"]], alt_b4_w3=V[["alt4"]]-mu_worst*V[["alt3"]]) ) P[["model"]] = apollo_mnl(mnl_settings, functionality) ### Take product across observation for same individual P = apollo_panelProd(P, apollo_inputs, functionality) ### Prepare and return outputs of function P = apollo_prepareProb(P, apollo_inputs, functionality) return(P) }