Page 1 of 1

Marginal rate of substitution for different sociodemographic groups

Posted: 31 Mar 2024, 17:54
by kkavta
Dear Prof. Hess.

I recently estimated a mixed logit model and calculated two different Marginal Rate of Substitution (MRS) indicators for the entire sample in the following way:

randcoeff[["b_tt"]] = -exp( mu_log_b_tt + sigma_log_b_tt * draws_tt )
randcoeff[["b_info"]] = exp(mu_log_b_info + sigma_log_b_info * draws_info)
randcoeff[["b_money"]] = exp(mu_log_b_money + sigma_log_b_money * draws_money)

1) Value of Risk Reduction (VRR) = (unconditionals[["b_info"]]/unconditionals[["b_tt"]])
(mean(VRR)); (sd(VRR))

2) Willingness to Accept (WTA) = (unconditionals[["b_tt"]]/unconditionals[["b_money"]])
(mean(WTA)); (sd(WTA))

Now, I aim to calculate these indicators for different socio-demographic groups using the below code:

VRR_ageL35 = (unconditionals[["b_info"]]/unconditionals[["b_tt"]]* (database$age == 1|database$age==2|database$age ==3))
(mean(VRR_ageL35)); (sd(VRR_ageL35))

WTA_ageL35 = ((unconditionals[["b_tt"]]/unconditionals[["b_money"]]) * (database$age == 1|database$age==2|database$age ==3))
(mean(WTA_ageL35)); (sd(WTA_ageL35))

The questions are the following:

A) Is the way I'm using to calculate MRS for different socio-demographic groups correct? If it is correct way, then my next question is:

B) Behaviorally, the values of VRR and WTA should have inverse relation, i.e. the socio-demogrpahic group that has higher value for VRR should have lower value for WTA, but unfortunately it is not the case in the results. What could be the reason for this?

Thank you for your kind support.

Regards,
K

Re: Marginal rate of substitution for different sociodemographic groups

Posted: 02 Apr 2024, 15:15
by stephanehess
Hi

it looks like you are not including those socio-demographics in the random coefficients, so they would not affect the MRS

Regarding your code, you will want to use subset instead of multiplication by a 0/1 indicator

Stephane

Re: Marginal rate of substitution for different sociodemographic groups

Posted: 02 Apr 2024, 19:05
by kkavta
Dear Prof. Hess,

Thank you for the reply.

Is it must to add socio-demographic variables in randcoeff to get MRS for different SD group? Instead can't it be obtained just by splitting the data base for the SD group of interest and calculating MRS?

I attempted to conduct the analysis by changing the database specific to SD group and then calculating the MRS separately. However, I encountered a issue where the MRS values do not change despite changes in the database. Could you kindly review the code below to identify any potential errors?

Code: Select all

unconditionals <- apollo_unconditionals(model,apollo_probabilities,apollo_inputs)

conditionals <- apollo_conditionals(model,apollo_probabilities,apollo_inputs)

mean(unconditionals[["b_tt"]])
sd(unconditionals[["b_tt"]])
summary(conditionals[["b_tt"]])

mean(unconditionals[["b_info"]])
sd(unconditionals[["b_info"]])
summary(conditionals[["b_info"]])

mean(unconditionals[["b_money"]])
sd(unconditionals[["b_money"]])
summary(conditionals[["b_money"]])

VRR = (unconditionals[["b_info"]]/unconditionals[["b_tt"]])
(mean(VRR)); (sd(VRR))

summary((conditionals[["b_info"]]/conditionals[["b_tt"]]))

WTA = (unconditionals[["b_tt"]]/unconditionals[["b_money"]])
(mean(WTA)); (sd(WTA))

summary((conditionals[["b_tt"]]/conditionals[["b_money"]]))

database_backup=database

database = subset(database,(database$age == 1|database$age==2|database$age ==3))

apollo_inputs = apollo_validateInputs()

VRR_ageL35 = (unconditionals[["b_info"]]/unconditionals[["b_tt"]])
(mean(VRR_ageL35)); (sd(VRR_ageL35))

WTA_ageL35 = ((unconditionals[["b_tt"]]/unconditionals[["b_money"]]))
(mean(WTA_ageL35)); (sd(WTA_ageL35))
database = database_backup

database = subset(database,(database$job_exp==1))

apollo_inputs = apollo_validateInputs()

VRR_expL1 = ((unconditionals[["b_info"]]/unconditionals[["b_tt"]]))
(mean(VRR_expL1)); (sd(VRR_expL1))

WTA_expL1 = ((unconditionals[["b_tt"]]/unconditionals[["b_money"]]))
(mean(WTA_expL1)); (sd(WTA_expL1))

Thank you,
K

Re: Marginal rate of substitution for different sociodemographic groups

Posted: 24 Apr 2024, 15:31
by stephanehess
Hi

your unconditional distributions will not be different for people with different socio-demographics unless you have included the interactions in apollo_randCoeff. So subsetting the data will not do anything

Stephane