Page 2 of 2

Re: mixed logit query

Posted: 01 Dec 2023, 14:39
by georkapo
Dear Stephane,

I have calculated two models, model A : ten random coefficients, model B : ten random coefficients and I have allowed for differences between genders in the cost coefficient

Code: Select all

randcoeff[["b_cost"]] = -exp( mu_log_b_cost + sigma_log_b_cost * draws_cost + (gender == 1) * ( mu_male_cost + sigma_male_cost * draws_male_cost))
Both models estimate quite similar values, however, when I calculate the wtp I get different values. Could you help with this?
here I put the results:
Model A:

Code: Select all

asc_A                                     2.151528     0.22276       9.658     0.26878         8.005
asc_B                                     2.211906     0.23028       9.605     0.27836         7.946
asc_C                                     0.000000          NA          NA          NA            NA
mu_b_Assistance_emergency_unit            0.030000          NA          NA          NA            NA
mu_b_Assistance_emergency_call            0.160136     0.09213       1.738     0.08260         1.939
mu_b_Assistance_smart_routes              0.577922     0.12109       4.773     0.12325         4.689
mu_b_Automatic_speed_safe_distance        0.100000          NA          NA          NA            NA
mu_b_Automatic_speed_speed_limit          0.560489     0.16221       3.455     0.17030         3.291
mu_b_Automatic_speed_risky_areas          0.345235     0.16378       2.108     0.16818         2.053
mu_b_Collision_avoidance_front_side       0.100000          NA          NA          NA            NA
mu_b_Collision_avoidance_rear_side        0.345127     0.09592       3.598     0.09306         3.709
mu_b_Collision_avoidance_blind_spot       0.346942     0.10482       3.310     0.10468         3.314
mu_log_b_cost                            -4.908550     0.07708     -63.678     0.08272       -59.337
sigma_b_Assistance_emergency_unit        -0.680916     0.18195      -3.742     0.18564        -3.668
sigma_b_Assistance_emergency_call        -0.444675     0.24878      -1.787     0.26330        -1.689
sigma_b_Assistance_smart_routes           1.300542     0.17620       7.381     0.19487         6.674
sigma_b_Automatic_speed_safe_distance     0.913538     0.18647       4.899     0.19675         4.643
sigma_b_Automatic_speed_speed_limit       0.540927     0.20983       2.578     0.20854         2.594
sigma_b_Automatic_speed_risky_areas      -0.689575     0.17069      -4.040     0.16743        -4.119
sigma_b_Collision_avoidance_front_side   -0.725422     0.17067      -4.251     0.16538        -4.386
sigma_b_Collision_avoidance_rear_side     0.465637     0.23245       2.003     0.22063         2.110
sigma_b_Collision_avoidance_blind_spot   -0.934059     0.16729      -5.584     0.17004        -5.493
sigma_log_b_cost                         -1.167197     0.07783     -14.996     0.08466       -13.787
Model B

Code: Select all

asc_A                                      2.12731     0.20462      10.396     0.25029         8.499
asc_B                                      2.19177     0.21065      10.405     0.25676         8.536
asc_C                                      0.00000          NA          NA          NA            NA
mu_b_Assistance_emergency_unit             0.03000          NA          NA          NA            NA
mu_b_Assistance_emergency_call             0.13904     0.08710       1.596     0.08286         1.678
mu_b_Assistance_smart_routes               0.53068     0.11150       4.760     0.11510         4.611
mu_b_Automatic_speed_safe_distance         0.10000          NA          NA          NA            NA
mu_b_Automatic_speed_speed_limit           0.54664     0.15187       3.599     0.15773         3.466
mu_b_Automatic_speed_risky_areas           0.31619     0.15504       2.039     0.15844         1.996
mu_b_Collision_avoidance_front_side        0.10000          NA          NA          NA            NA
mu_b_Collision_avoidance_rear_side         0.32022     0.08860       3.614     0.09112         3.514
mu_b_Collision_avoidance_blind_spot        0.29924     0.09811       3.050     0.09934         3.012
mu_log_b_cost                             -5.09219     0.07935     -64.176     0.09669       -52.668
mu_male_cost                              -0.26587     0.10362      -2.566     0.12654        -2.101
sigma_b_Assistance_emergency_unit         -0.46741     0.18346      -2.548     0.23588        -1.982
sigma_b_Assistance_emergency_call         -0.53741     0.14835      -3.623     0.15022        -3.578
sigma_b_Assistance_smart_routes           -1.30353     0.16783      -7.767     0.23157        -5.629
sigma_b_Automatic_speed_safe_distance      0.92836     0.17130       5.419     0.20661         4.493
sigma_b_Automatic_speed_speed_limit       -0.40859     0.15645      -2.612     0.15647        -2.611
sigma_b_Automatic_speed_risky_areas        0.62139     0.14442       4.303     0.15242         4.077
sigma_b_Collision_avoidance_front_side     0.60242     0.16110       3.739     0.17589         3.425
sigma_b_Collision_avoidance_rear_side     -0.35168     0.20753      -1.695     0.24409        -1.441
sigma_b_Collision_avoidance_blind_spot    -0.95595     0.14599      -6.548     0.17027        -5.614
sigma_log_b_cost                           1.34944     0.08403      16.058     0.09832        13.724
sigma_male_cost                            0.54037     0.08825       6.124     0.10083         5.359
Estimation of the WTP:
Model A :

Code: Select all

> (mean(wtp_routes)); (sd(wtp_routes))
[1] 154.4723
[1] 734.7984
Model B :

Code: Select all

> (mean(wtp_routes)); (sd(wtp_routes))
[1] 263.9358
[1] 2040.514
I calculate the wtp with the same approach by using apollo_unconditionals.
There is a big difference, while the coefficients are similar. Could you give any insights on this?

I really appreciate any hint. Thank you in advance.

Best regards,
Georgios

Re: mixed logit query

Posted: 01 Dec 2023, 16:05
by stephanehess
Georgios

you mean standard deviation, not standard error, I guess. When you allow for more heterogeneity, then the sd would be higher. Why are you surprised?
georkapo wrote: 29 Nov 2023, 12:32 Dear Stephane,

One additional question related to the previous one.
When I use a single random coefficient allowing for differences between men and women, there is a higher sd error for the attributes e.g.
> (mean(wtp_unit)); (sd(wtp_unit))
[1] 12.42137
[1] 587.157
while when I do not allow for differences between men and women, the sd is lower
> (mean(wtp_unit)); (sd(wtp_unit))
[1] 8.141867
[1] 360.8153
Thank you very much for your support.
Best regards,
Georgios

Re: mixed logit query

Posted: 01 Dec 2023, 16:06
by stephanehess
Hi

your second model allows for differences in cost sensitivity between men and women, so it's quite normal that you would get differences in the WTP. Does that not make sense to you?

Stephane
georkapo wrote: 01 Dec 2023, 14:39 Dear Stephane,

I have calculated two models, model A : ten random coefficients, model B : ten random coefficients and I have allowed for differences between genders in the cost coefficient

Code: Select all

randcoeff[["b_cost"]] = -exp( mu_log_b_cost + sigma_log_b_cost * draws_cost + (gender == 1) * ( mu_male_cost + sigma_male_cost * draws_male_cost))
Both models estimate quite similar values, however, when I calculate the wtp I get different values. Could you help with this?
here I put the results:
Model A:

Code: Select all

asc_A                                     2.151528     0.22276       9.658     0.26878         8.005
asc_B                                     2.211906     0.23028       9.605     0.27836         7.946
asc_C                                     0.000000          NA          NA          NA            NA
mu_b_Assistance_emergency_unit            0.030000          NA          NA          NA            NA
mu_b_Assistance_emergency_call            0.160136     0.09213       1.738     0.08260         1.939
mu_b_Assistance_smart_routes              0.577922     0.12109       4.773     0.12325         4.689
mu_b_Automatic_speed_safe_distance        0.100000          NA          NA          NA            NA
mu_b_Automatic_speed_speed_limit          0.560489     0.16221       3.455     0.17030         3.291
mu_b_Automatic_speed_risky_areas          0.345235     0.16378       2.108     0.16818         2.053
mu_b_Collision_avoidance_front_side       0.100000          NA          NA          NA            NA
mu_b_Collision_avoidance_rear_side        0.345127     0.09592       3.598     0.09306         3.709
mu_b_Collision_avoidance_blind_spot       0.346942     0.10482       3.310     0.10468         3.314
mu_log_b_cost                            -4.908550     0.07708     -63.678     0.08272       -59.337
sigma_b_Assistance_emergency_unit        -0.680916     0.18195      -3.742     0.18564        -3.668
sigma_b_Assistance_emergency_call        -0.444675     0.24878      -1.787     0.26330        -1.689
sigma_b_Assistance_smart_routes           1.300542     0.17620       7.381     0.19487         6.674
sigma_b_Automatic_speed_safe_distance     0.913538     0.18647       4.899     0.19675         4.643
sigma_b_Automatic_speed_speed_limit       0.540927     0.20983       2.578     0.20854         2.594
sigma_b_Automatic_speed_risky_areas      -0.689575     0.17069      -4.040     0.16743        -4.119
sigma_b_Collision_avoidance_front_side   -0.725422     0.17067      -4.251     0.16538        -4.386
sigma_b_Collision_avoidance_rear_side     0.465637     0.23245       2.003     0.22063         2.110
sigma_b_Collision_avoidance_blind_spot   -0.934059     0.16729      -5.584     0.17004        -5.493
sigma_log_b_cost                         -1.167197     0.07783     -14.996     0.08466       -13.787
Model B

Code: Select all

asc_A                                      2.12731     0.20462      10.396     0.25029         8.499
asc_B                                      2.19177     0.21065      10.405     0.25676         8.536
asc_C                                      0.00000          NA          NA          NA            NA
mu_b_Assistance_emergency_unit             0.03000          NA          NA          NA            NA
mu_b_Assistance_emergency_call             0.13904     0.08710       1.596     0.08286         1.678
mu_b_Assistance_smart_routes               0.53068     0.11150       4.760     0.11510         4.611
mu_b_Automatic_speed_safe_distance         0.10000          NA          NA          NA            NA
mu_b_Automatic_speed_speed_limit           0.54664     0.15187       3.599     0.15773         3.466
mu_b_Automatic_speed_risky_areas           0.31619     0.15504       2.039     0.15844         1.996
mu_b_Collision_avoidance_front_side        0.10000          NA          NA          NA            NA
mu_b_Collision_avoidance_rear_side         0.32022     0.08860       3.614     0.09112         3.514
mu_b_Collision_avoidance_blind_spot        0.29924     0.09811       3.050     0.09934         3.012
mu_log_b_cost                             -5.09219     0.07935     -64.176     0.09669       -52.668
mu_male_cost                              -0.26587     0.10362      -2.566     0.12654        -2.101
sigma_b_Assistance_emergency_unit         -0.46741     0.18346      -2.548     0.23588        -1.982
sigma_b_Assistance_emergency_call         -0.53741     0.14835      -3.623     0.15022        -3.578
sigma_b_Assistance_smart_routes           -1.30353     0.16783      -7.767     0.23157        -5.629
sigma_b_Automatic_speed_safe_distance      0.92836     0.17130       5.419     0.20661         4.493
sigma_b_Automatic_speed_speed_limit       -0.40859     0.15645      -2.612     0.15647        -2.611
sigma_b_Automatic_speed_risky_areas        0.62139     0.14442       4.303     0.15242         4.077
sigma_b_Collision_avoidance_front_side     0.60242     0.16110       3.739     0.17589         3.425
sigma_b_Collision_avoidance_rear_side     -0.35168     0.20753      -1.695     0.24409        -1.441
sigma_b_Collision_avoidance_blind_spot    -0.95595     0.14599      -6.548     0.17027        -5.614
sigma_log_b_cost                           1.34944     0.08403      16.058     0.09832        13.724
sigma_male_cost                            0.54037     0.08825       6.124     0.10083         5.359
Estimation of the WTP:
Model A :

Code: Select all

> (mean(wtp_routes)); (sd(wtp_routes))
[1] 154.4723
[1] 734.7984
Model B :

Code: Select all

> (mean(wtp_routes)); (sd(wtp_routes))
[1] 263.9358
[1] 2040.514
I calculate the wtp with the same approach by using apollo_unconditionals.
There is a big difference, while the coefficients are similar. Could you give any insights on this?

I really appreciate any hint. Thank you in advance.

Best regards,
Georgios

Re: mixed logit query

Posted: 01 Dec 2023, 16:27
by georkapo
Hi Stephane,

Thank you for your quick response.
your second model allows for differences in cost sensitivity between men and women, so it's quite normal that you would get differences in the WTP. Does that not make sense to you?
Indeed, since I allow for differences in cost, I get different values of WTP, however, it surprised me that the differences are so huge (wtp and the sd), while the estimations are quite similar, e.g., mu_Assistance_smart_routes: 0.577922, sigma_Assistance_smart_routes: 1.300542 and mu_Assistance_smart_routes: 0.53068, sigma_Assistance_smart_routes: -1.30353

Also, by allowing differences in cost sensitivity between men and women, what would be the correct estimation for the WTP?

Should I estimate first only for the b_cost and then for the mu_male_cost? how can I interpret the results?

Code: Select all

wtp_routes  <- -(unconditionals[["Assistance_smart_routes"]]/unconditionals[["b_cost"]])

Code: Select all

wtp_male_Assistance_smart_routes <- (unconditionals[["Assistance_smart_routes"]])/(unconditionals[["b_cost"]]) + (unconditionals[["Assistance_smart_routes"]])/(unconditionals[["b_cost"]]+model$estimate["mu_male_cost"]/model$estimate["sigma_male_cost"])
Thank you again, and I'm sorry for bothering you.

Best regards,
Georgios

Re: mixed logit query

Posted: 04 Dec 2023, 10:43
by stephanehess
Georgios

you are only comparing the parameters in the numerator of WTP there, but of course, the cost coefficient now includes a gender interaction, with an additive variance for male, so there will be a lot more heterogeneity in the cost sensitivity, and hence in WTP

Regarding computation, if you have used (as I suggested)

Code: Select all

randcoeff[["b_cost"]] = -exp( mu_log_b_cost + sigma_log_b_cost * draws_cost + (gender == 1) * ( mu_male_cost + sigma_male_cost * draws_male_cost))
then your WTP is simply

Code: Select all

wtp_routes  <- -(unconditionals[["Assistance_smart_routes"]]/unconditionals[["b_cost"]])
as unconditionals[["b_cost"]] already includes the gender interaction

Stephane & David