Model run by stephane.hess using Apollo 0.2.9 on R 4.0.5 for Darwin. www.ApolloChoiceModelling.com Model name : BW_simultaneous Model description : Best-worst model on drug choice data, simultaneous choice Model run at : 2023-05-10 22:04:45 Estimation method : bfgs Model diagnosis : successful convergence Optimisation diagnosis : Maximum found hessian properties : Negative definitive maximum eigenvalue : -173.748204 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:35.45 pre-estimation : 00:00:10.62 estimation : 00:00:10.49 initial estimation : 00:00:9.51 estimation after rescaling : 00:00:0.98 post-estimation : 00:00:14.34 Iterations : 28 initial estimation : 27 estimation after rescaling : 1 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.255567 0.02338 -10.931 0.02333 -10.955 b_brand_BestValue -0.471513 0.04180 -11.281 0.04341 -10.861 b_brand_Supermarket -0.247521 0.04305 -5.750 0.04685 -5.283 b_brand_PainAway -0.967297 0.04421 -21.877 0.04640 -20.846 b_country_CH 0.512747 0.03057 16.773 0.03006 17.059 b_country_DK 0.249931 0.02875 8.693 0.02818 8.869 b_country_USA 0.000000 NA NA NA NA b_country_IND -0.204655 0.03598 -5.688 0.03687 -5.551 b_country_RUS -0.683617 0.03816 -17.914 0.03832 -17.839 b_country_BRA -0.482954 0.03726 -12.963 0.03838 -12.583 b_char_standard 0.000000 NA NA NA NA b_char_fast 0.602504 0.02158 27.914 0.02149 28.030 b_char_double 0.968335 0.03013 32.141 0.02907 33.312 b_risk -0.001234 4.062e-05 -30.384 4.096e-05 -30.128 b_price -0.600681 0.01469 -40.901 0.01391 -43.171 mu_worst 0.814974 0.02726 29.894 0.02677 30.444 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 alt_b3_w1 Times available 10000.00 10000.00 10000.00 10000.0 10000.00 10000.00 10000.0 Times chosen 698.00 1358.00 1347.00 680.0 1447.00 1419.00 410.0 Percentage chosen overall 6.98 13.58 13.47 6.8 14.47 14.19 4.1 Percentage chosen when available 6.98 13.58 13.47 6.8 14.47 14.19 4.1 alt_b3_w2 alt_b3_w4 alt_b4_w1 alt_b4_w2 alt_b4_w3 Times available 10000.00 10000.00 10000.00 10000.00 10000.00 Times chosen 431.00 676.00 441.00 416.00 677.00 Percentage chosen overall 4.31 6.76 4.41 4.16 6.77 Percentage chosen when available 4.31 6.76 4.41 4.16 6.77 Classical covariance matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_PainAway b_brand_Novum 5.4667e-04 2.9125e-04 3.2418e-04 3.2002e-04 b_brand_BestValue 2.9125e-04 0.001747 0.001322 0.001286 b_brand_Supermarket 3.2418e-04 0.001322 0.001853 0.001259 b_brand_PainAway 3.2002e-04 0.001286 0.001259 0.001955 b_country_CH -4.732e-05 3.8439e-04 4.2145e-04 2.7661e-04 b_country_DK -4.212e-05 3.7202e-04 4.0505e-04 3.2278e-04 b_country_IND -1.458e-05 -6.0242e-04 -6.4239e-04 -5.3777e-04 b_country_RUS 5.156e-06 -5.7711e-04 -6.5198e-04 -3.9889e-04 b_country_BRA 1.172e-05 -5.5647e-04 -6.6916e-04 -4.6717e-04 b_char_fast -9.676e-06 -3.358e-07 6.496e-05 -1.5996e-04 b_char_double 3.448e-05 2.0440e-04 2.8542e-04 3.111e-05 b_risk 4.154e-08 -1.857e-07 -3.354e-07 2.511e-07 b_price 3.542e-05 1.8063e-04 1.3792e-04 2.8671e-04 mu_worst 2.584e-05 1.495e-05 -1.0954e-04 3.3601e-04 b_country_CH b_country_DK b_country_IND b_country_RUS b_brand_Novum -4.732e-05 -4.212e-05 -1.458e-05 5.156e-06 b_brand_BestValue 3.8439e-04 3.7202e-04 -6.0242e-04 -5.7711e-04 b_brand_Supermarket 4.2145e-04 4.0505e-04 -6.4239e-04 -6.5198e-04 b_brand_PainAway 2.7661e-04 3.2278e-04 -5.3777e-04 -3.9889e-04 b_country_CH 9.3446e-04 4.3414e-04 -6.135e-05 -1.3003e-04 b_country_DK 4.3414e-04 8.2665e-04 5.088e-06 -5.206e-05 b_country_IND -6.135e-05 5.088e-06 0.001295 6.8524e-04 b_country_RUS -1.3003e-04 -5.206e-05 6.8524e-04 0.001456 b_country_BRA -1.2371e-04 -6.806e-05 6.9320e-04 7.4909e-04 b_char_fast 1.1483e-04 6.653e-05 -8.703e-05 -1.8227e-04 b_char_double 1.3002e-04 5.294e-05 -8.135e-05 -1.9244e-04 b_risk -2.228e-07 -1.201e-07 1.399e-07 4.221e-07 b_price -9.934e-05 -3.923e-05 5.706e-05 1.3647e-04 mu_worst -1.7277e-04 -9.368e-05 1.3161e-04 3.5608e-04 b_country_BRA b_char_fast b_char_double b_risk b_brand_Novum 1.172e-05 -9.676e-06 3.448e-05 4.154e-08 b_brand_BestValue -5.5647e-04 -3.358e-07 2.0440e-04 -1.857e-07 b_brand_Supermarket -6.6916e-04 6.496e-05 2.8542e-04 -3.354e-07 b_brand_PainAway -4.6717e-04 -1.5996e-04 3.111e-05 2.511e-07 b_country_CH -1.2371e-04 1.1483e-04 1.3002e-04 -2.228e-07 b_country_DK -6.806e-05 6.653e-05 5.294e-05 -1.201e-07 b_country_IND 6.9320e-04 -8.703e-05 -8.135e-05 1.399e-07 b_country_RUS 7.4909e-04 -1.8227e-04 -1.9244e-04 4.221e-07 b_country_BRA 0.001388 -1.3124e-04 -1.4592e-04 2.431e-07 b_char_fast -1.3124e-04 4.6587e-04 3.1376e-04 -2.965e-07 b_char_double -1.4592e-04 3.1376e-04 9.0769e-04 -3.552e-07 b_risk 2.431e-07 -2.965e-07 -3.552e-07 1.650e-09 b_price 1.1361e-04 -1.1129e-04 -1.3802e-04 2.737e-07 mu_worst 2.3621e-04 -2.4220e-04 -2.9210e-04 7.286e-07 b_price mu_worst b_brand_Novum 3.542e-05 2.584e-05 b_brand_BestValue 1.8063e-04 1.495e-05 b_brand_Supermarket 1.3792e-04 -1.0954e-04 b_brand_PainAway 2.8671e-04 3.3601e-04 b_country_CH -9.934e-05 -1.7277e-04 b_country_DK -3.923e-05 -9.368e-05 b_country_IND 5.706e-05 1.3161e-04 b_country_RUS 1.3647e-04 3.5608e-04 b_country_BRA 1.1361e-04 2.3621e-04 b_char_fast -1.1129e-04 -2.4220e-04 b_char_double -1.3802e-04 -2.9210e-04 b_risk 2.737e-07 7.286e-07 b_price 2.1568e-04 1.9962e-04 mu_worst 1.9962e-04 7.4323e-04 Robust covariance matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_PainAway b_brand_Novum 5.4422e-04 2.4682e-04 3.0186e-04 2.9564e-04 b_brand_BestValue 2.4682e-04 0.001885 0.001519 0.001450 b_brand_Supermarket 3.0186e-04 0.001519 0.002195 0.001476 b_brand_PainAway 2.9564e-04 0.001450 0.001476 0.002153 b_country_CH -9.091e-05 2.9332e-04 3.5028e-04 2.0299e-04 b_country_DK -6.105e-05 2.5717e-04 3.1546e-04 2.4744e-04 b_country_IND 4.576e-06 -6.2399e-04 -6.8268e-04 -5.0714e-04 b_country_RUS 3.308e-05 -6.0574e-04 -7.0540e-04 -4.0667e-04 b_country_BRA 5.867e-05 -6.0409e-04 -7.4093e-04 -4.6711e-04 b_char_fast -4.706e-05 -1.941e-05 7.649e-05 -1.6571e-04 b_char_double -1.852e-05 1.2341e-04 2.4357e-04 -4.144e-05 b_risk 6.338e-08 -1.718e-07 -3.574e-07 2.267e-07 b_price 4.691e-05 1.5951e-04 1.0415e-04 2.5785e-04 mu_worst 6.333e-05 2.251e-06 -1.3711e-04 3.2573e-04 b_country_CH b_country_DK b_country_IND b_country_RUS b_brand_Novum -9.091e-05 -6.105e-05 4.576e-06 3.308e-05 b_brand_BestValue 2.9332e-04 2.5717e-04 -6.2399e-04 -6.0574e-04 b_brand_Supermarket 3.5028e-04 3.1546e-04 -6.8268e-04 -7.0540e-04 b_brand_PainAway 2.0299e-04 2.4744e-04 -5.0714e-04 -4.0667e-04 b_country_CH 9.0340e-04 4.0180e-04 -6.958e-05 -1.6581e-04 b_country_DK 4.0180e-04 7.9408e-04 4.663e-06 -5.429e-05 b_country_IND -6.958e-05 4.663e-06 0.001359 6.8577e-04 b_country_RUS -1.6581e-04 -5.429e-05 6.8577e-04 0.001469 b_country_BRA -1.4136e-04 -8.198e-05 7.4839e-04 8.4252e-04 b_char_fast 1.2314e-04 5.958e-05 -1.1389e-04 -2.3133e-04 b_char_double 1.2098e-04 3.873e-05 -1.3679e-04 -2.3313e-04 b_risk -1.835e-07 -6.437e-08 1.907e-07 4.838e-07 b_price -9.256e-05 -3.802e-05 7.958e-05 1.5371e-04 mu_worst -1.9400e-04 -1.1200e-04 1.4356e-04 3.6952e-04 b_country_BRA b_char_fast b_char_double b_risk b_brand_Novum 5.867e-05 -4.706e-05 -1.852e-05 6.338e-08 b_brand_BestValue -6.0409e-04 -1.941e-05 1.2341e-04 -1.718e-07 b_brand_Supermarket -7.4093e-04 7.649e-05 2.4357e-04 -3.574e-07 b_brand_PainAway -4.6711e-04 -1.6571e-04 -4.144e-05 2.267e-07 b_country_CH -1.4136e-04 1.2314e-04 1.2098e-04 -1.835e-07 b_country_DK -8.198e-05 5.958e-05 3.873e-05 -6.437e-08 b_country_IND 7.4839e-04 -1.1389e-04 -1.3679e-04 1.907e-07 b_country_RUS 8.4252e-04 -2.3133e-04 -2.3313e-04 4.838e-07 b_country_BRA 0.001473 -1.7335e-04 -2.1568e-04 3.082e-07 b_char_fast -1.7335e-04 4.6202e-04 3.1166e-04 -2.994e-07 b_char_double -2.1568e-04 3.1166e-04 8.4501e-04 -3.151e-07 b_risk 3.082e-07 -2.994e-07 -3.151e-07 1.678e-09 b_price 1.3300e-04 -1.1435e-04 -1.3581e-04 2.604e-07 mu_worst 2.7417e-04 -2.6384e-04 -2.8021e-04 7.359e-07 b_price mu_worst b_brand_Novum 4.691e-05 6.333e-05 b_brand_BestValue 1.5951e-04 2.251e-06 b_brand_Supermarket 1.0415e-04 -1.3711e-04 b_brand_PainAway 2.5785e-04 3.2573e-04 b_country_CH -9.256e-05 -1.9400e-04 b_country_DK -3.802e-05 -1.1200e-04 b_country_IND 7.958e-05 1.4356e-04 b_country_RUS 1.5371e-04 3.6952e-04 b_country_BRA 1.3300e-04 2.7417e-04 b_char_fast -1.1435e-04 -2.6384e-04 b_char_double -1.3581e-04 -2.8021e-04 b_risk 2.604e-07 7.359e-07 b_price 1.9360e-04 1.9711e-04 mu_worst 1.9711e-04 7.1662e-04 Classical correlation matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_PainAway b_brand_Novum 1.000000 0.29803 0.32208 0.30956 b_brand_BestValue 0.298028 1.00000 0.73498 0.69590 b_brand_Supermarket 0.322081 0.73498 1.00000 0.66164 b_brand_PainAway 0.309564 0.69590 0.66164 1.00000 b_country_CH -0.066204 0.30084 0.32026 0.20465 b_country_DK -0.062660 0.30956 0.32725 0.25391 b_country_IND -0.017333 -0.40057 -0.41474 -0.33804 b_country_RUS 0.005779 -0.36182 -0.39688 -0.23642 b_country_BRA 0.013459 -0.35734 -0.41721 -0.28359 b_char_fast -0.019175 -3.7224e-04 0.06991 -0.16762 b_char_double 0.048946 0.16231 0.22007 0.02335 b_risk 0.043736 -0.10935 -0.19184 0.13983 b_price 0.103165 0.29426 0.21815 0.44154 mu_worst 0.040532 0.01312 -0.09334 0.27876 b_country_CH b_country_DK b_country_IND b_country_RUS b_brand_Novum -0.06620 -0.062660 -0.017333 0.005779 b_brand_BestValue 0.30084 0.309560 -0.400573 -0.361822 b_brand_Supermarket 0.32026 0.327255 -0.414735 -0.396879 b_brand_PainAway 0.20465 0.253909 -0.338038 -0.236415 b_country_CH 1.00000 0.493959 -0.055781 -0.111471 b_country_DK 0.49396 1.000000 0.004918 -0.047447 b_country_IND -0.05578 0.004918 1.000000 0.499076 b_country_RUS -0.11147 -0.047447 0.499076 1.000000 b_country_BRA -0.10862 -0.063538 0.517108 0.526881 b_char_fast 0.17403 0.107208 -0.112061 -0.221289 b_char_double 0.14117 0.061121 -0.075048 -0.167383 b_risk -0.17942 -0.102878 0.095741 0.272320 b_price -0.22129 -0.092900 0.107984 0.243510 mu_worst -0.20731 -0.119520 0.134174 0.342278 b_country_BRA b_char_fast b_char_double b_risk b_brand_Novum 0.01346 -0.01917 0.04895 0.04374 b_brand_BestValue -0.35734 -3.7224e-04 0.16231 -0.10935 b_brand_Supermarket -0.41721 0.06991 0.22007 -0.19184 b_brand_PainAway -0.28359 -0.16762 0.02335 0.13983 b_country_CH -0.10862 0.17403 0.14117 -0.17942 b_country_DK -0.06354 0.10721 0.06112 -0.10288 b_country_IND 0.51711 -0.11206 -0.07505 0.09574 b_country_RUS 0.52688 -0.22129 -0.16738 0.27232 b_country_BRA 1.00000 -0.16320 -0.13000 0.16063 b_char_fast -0.16320 1.00000 0.48250 -0.33815 b_char_double -0.13000 0.48250 1.00000 -0.29025 b_risk 0.16063 -0.33815 -0.29025 1.00000 b_price 0.20764 -0.35109 -0.31194 0.45880 mu_worst 0.23255 -0.41160 -0.35564 0.65799 b_price mu_worst b_brand_Novum 0.10317 0.04053 b_brand_BestValue 0.29426 0.01312 b_brand_Supermarket 0.21815 -0.09334 b_brand_PainAway 0.44154 0.27876 b_country_CH -0.22129 -0.20731 b_country_DK -0.09290 -0.11952 b_country_IND 0.10798 0.13417 b_country_RUS 0.24351 0.34228 b_country_BRA 0.20764 0.23255 b_char_fast -0.35109 -0.41160 b_char_double -0.31194 -0.35564 b_risk 0.45880 0.65799 b_price 1.00000 0.49859 mu_worst 0.49859 1.00000 Robust correlation matrix: b_brand_Novum b_brand_BestValue b_brand_Supermarket b_brand_PainAway b_brand_Novum 1.000000 0.243700 0.27620 0.27310 b_brand_BestValue 0.243700 1.000000 0.74680 0.71986 b_brand_Supermarket 0.276202 0.746804 1.00000 0.67888 b_brand_PainAway 0.273104 0.719859 0.67888 1.00000 b_country_CH -0.129653 0.224783 0.24876 0.14554 b_country_DK -0.092866 0.210211 0.23896 0.18923 b_country_IND 0.005320 -0.389847 -0.39525 -0.29644 b_country_RUS 0.037006 -0.364087 -0.39291 -0.22869 b_country_BRA 0.065521 -0.362525 -0.41206 -0.26227 b_char_fast -0.093841 -0.020803 0.07596 -0.16614 b_char_double -0.027313 0.097784 0.17886 -0.03072 b_risk 0.066323 -0.096582 -0.18623 0.11927 b_price 0.144532 0.264053 0.15978 0.39936 mu_worst 0.101402 0.001937 -0.10933 0.26222 b_country_CH b_country_DK b_country_IND b_country_RUS b_brand_Novum -0.12965 -0.092866 0.005320 0.03701 b_brand_BestValue 0.22478 0.210211 -0.389847 -0.36409 b_brand_Supermarket 0.24876 0.238960 -0.395252 -0.39291 b_brand_PainAway 0.14554 0.189228 -0.296439 -0.22869 b_country_CH 1.00000 0.474392 -0.062787 -0.14395 b_country_DK 0.47439 1.000000 0.004488 -0.05028 b_country_IND -0.06279 0.004488 1.000000 0.48538 b_country_RUS -0.14395 -0.050278 0.485379 1.00000 b_country_BRA -0.12253 -0.075796 0.528869 0.57281 b_char_fast 0.19061 0.098362 -0.143713 -0.28084 b_char_double 0.13846 0.047286 -0.127635 -0.20928 b_risk -0.14907 -0.055767 0.126302 0.30822 b_price -0.22132 -0.096961 0.155122 0.28827 mu_worst -0.24111 -0.148466 0.145455 0.36020 b_country_BRA b_char_fast b_char_double b_risk b_brand_Novum 0.06552 -0.09384 -0.02731 0.06632 b_brand_BestValue -0.36253 -0.02080 0.09778 -0.09658 b_brand_Supermarket -0.41206 0.07596 0.17886 -0.18623 b_brand_PainAway -0.26227 -0.16614 -0.03072 0.11927 b_country_CH -0.12253 0.19061 0.13846 -0.14907 b_country_DK -0.07580 0.09836 0.04729 -0.05577 b_country_IND 0.52887 -0.14371 -0.12764 0.12630 b_country_RUS 0.57281 -0.28084 -0.20928 0.30822 b_country_BRA 1.00000 -0.21011 -0.19330 0.19604 b_char_fast -0.21011 1.00000 0.49879 -0.34005 b_char_double -0.19330 0.49879 1.00000 -0.26464 b_risk 0.19604 -0.34005 -0.26464 1.00000 b_price 0.24904 -0.38234 -0.33579 0.45693 mu_worst 0.26684 -0.45852 -0.36009 0.67106 b_price mu_worst b_brand_Novum 0.14453 0.101402 b_brand_BestValue 0.26405 0.001937 b_brand_Supermarket 0.15978 -0.109327 b_brand_PainAway 0.39936 0.262223 b_country_CH -0.22132 -0.241115 b_country_DK -0.09696 -0.148466 b_country_IND 0.15512 0.145455 b_country_RUS 0.28827 0.360203 b_country_BRA 0.24904 0.266837 b_char_fast -0.38234 -0.458519 b_char_double -0.33579 -0.360092 b_risk 0.45693 0.671064 b_price 1.00000 0.529186 mu_worst 0.52919 1.000000 20 worst outliers in terms of lowest average per choice prediction: ID Avg prob per choice 875 0.04390887 593 0.04452403 367 0.04898529 859 0.05496749 947 0.05669279 476 0.06004168 8 0.06058993 524 0.06179081 70 0.06206551 611 0.06223178 933 0.06263245 499 0.06342095 288 0.06352833 287 0.06394017 1000 0.06403396 240 0.06415670 584 0.06417876 472 0.06442343 565 0.06458787 969 0.06487829 Changes in parameter estimates from starting values: Initial Estimate Difference b_brand_Artemis 0.000 0.000000 0.000000 b_brand_Novum 0.000 -0.255567 -0.255567 b_brand_BestValue 0.000 -0.471513 -0.471513 b_brand_Supermarket 0.000 -0.247521 -0.247521 b_brand_PainAway 0.000 -0.967297 -0.967297 b_country_CH 0.000 0.512747 0.512747 b_country_DK 0.000 0.249931 0.249931 b_country_USA 0.000 0.000000 0.000000 b_country_IND 0.000 -0.204655 -0.204655 b_country_RUS 0.000 -0.683617 -0.683617 b_country_BRA 0.000 -0.482954 -0.482954 b_char_standard 0.000 0.000000 0.000000 b_char_fast 0.000 0.602504 0.602504 b_char_double 0.000 0.968335 0.968335 b_risk 0.000 -0.001234 -0.001234 b_price 0.000 -0.600681 -0.600681 mu_worst 1.000 0.814974 -0.185026 Settings and functions used in model definition: apollo_control -------------- Value modelName "BW_simultaneous" modelDescr "Best-worst model on drug choice data, simultaneous choice" indivID "ID" outputDirectory "output/" debug "FALSE" nCores "1" workInLogs "FALSE" seed "13" mixing "FALSE" HB "FALSE" noValidation "FALSE" noDiagnostics "FALSE" calculateLLC "TRUE" panelData "TRUE" analyticGrad "TRUE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" Hessian routines attempted -------------------------- numerical jacobian of LL analytical gradient Scaling in estimation --------------------- Value b_brand_Novum 0.255568428 b_brand_BestValue 0.471505071 b_brand_Supermarket 0.247520886 b_brand_PainAway 0.967306666 b_country_CH 0.512746280 b_country_DK 0.249930394 b_country_IND 0.204654567 b_country_RUS 0.683610450 b_country_BRA 0.482943422 b_char_fast 0.602489527 b_char_double 0.968330062 b_risk 0.001234103 b_price 0.600711897 mu_worst 0.814951618 Scaling used in computing Hessian --------------------------------- Value b_brand_Novum 0.255566997 b_brand_BestValue 0.471512925 b_brand_Supermarket 0.247521173 b_brand_PainAway 0.967296683 b_country_CH 0.512746864 b_country_DK 0.249930946 b_country_IND 0.204654912 b_country_RUS 0.683616729 b_country_BRA 0.482954392 b_char_fast 0.602503971 b_char_double 0.968334515 b_risk 0.001234138 b_price 0.600681285 mu_worst 0.814974472 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) }