Hello, I am trying to fit a two-step model where the first equation is a binary logit and the second equation is a fractional logit. I don't think the command -twopm- has the option for a fractional logit in the second stage, so I was wondering if the commands below would properly implement the model. I have also included the -dataex- output for the variables. For more background, I am interested in modeling the variable avrg_prop_dental_cost, which represents the proportion of out-of-pocket dental costs to household income.
Code:
****creating a proportion variable and estimating using fractional logit model**** gen oopdental_proportion_wave1 = oopdental_costs_wave1/HouseholdIncome_wave1 replace oopdental_proportion_wave1=0 if oopdental_costs_wave1==0 & HouseholdIncome_wave1==0 drop if oopdental_proportion_wave1 >1 gen oopdental_proportion_wave2 = oopdental_costs_wave2/HouseholdIncome_wave2 replace oopdental_proportion_wave2 = 0 if oopdental_costs_wave2 ==0 & HouseholdIncome_wave2==0 drop if oopdental_proportion_wave2>1 ***generating an average variable**** egen avrg_prop_dental_cost = rowmean(oopdental_proportion_wave1 oopdental_proportion_wave2) **first step logit model**** logit r11dentst inc_d i.endentulism i.race i.age_cat i.male i.education i.veteran i.mothered i.dentalinsurance_w1 i.QuantHI_wave1 i.Quant_wealth_wave1 /// i.smoke_now c.chronicdisease i.r11dentst **second fractional logit*** fracreg logit avrg_prop_dental_cost r11dentst inc_d i.endentulism i.race i.age_cat i.male i.education i.veteran i.mothered i.dentalinsurance_w1 i.QuantHI_wave1 i.Quant_wealth_wave1 if avrg_prop_dental_cost >0
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float avrg_prop_dental_cost byte r11dentst float(inc_d endentulism race age_cat) byte(male education veteran) float(mothered dentalinsurance_w1) byte(QuantHI_wave1 Quant_wealth_wave1)
.003784648 1 0 0 1 3 0 5 0 1 0 3 4
0 1 0 0 1 1 0 5 0 1 1 1 3
.021537896 1 0 0 1 2 0 3 0 0 1 4 4
.09236358 1 0 0 1 2 0 4 0 1 0 1 4
.0046232087 1 0 0 1 3 1 5 1 1 1 4 4
.04624664 1 0 0 1 2 0 5 0 0 1 4 4
.0019889215 1 0 0 4 3 0 5 0 1 1 4 4
0 0 0 0 3 3 0 1 0 . 1 1 1
.16542825 1 0 0 3 3 0 1 0 0 1 1 1
.033333335 1 0 0 1 2 0 1 0 1 1 1 4
.02422194 1 0 0 1 4 1 5 1 0 0 3 4
0 1 0 0 3 3 0 1 0 0 1 1 1
0 0 0 1 4 3 1 1 0 0 1 1 1
0 1 0 1 2 3 0 3 0 0 1 1 1
0 0 0 0 2 3 1 1 0 . 0 1 1
.01634702 1 0 0 1 3 0 4 0 1 1 4 1
0 0 1 1 2 3 0 1 0 . 1 2 1
.04144562 1 0 0 1 3 0 4 0 1 1 3 4
.0035514846 1 0 0 1 3 1 5 1 1 1 4 4
.14424561 1 0 0 1 3 0 1 0 1 0 2 4
0 0 0 0 1 3 0 3 0 1 0 1 3
.002596046 1 0 1 4 3 0 5 0 0 1 4 3
.002776852 0 0 0 4 3 1 5 1 0 1 4 3
.0032806755 1 0 0 1 3 0 3 0 0 1 3 4
0 0 0 1 1 3 1 4 1 . 1 3 3
.020654306 1 0 0 1 2 0 5 0 1 1 3 3
.3813447 1 0 0 1 4 0 5 0 1 0 4 4
.016246201 1 0 0 1 3 1 5 1 1 0 1 4
.10871864 1 0 0 1 3 0 3 0 1 0 1 4
.01777209 1 0 0 1 3 1 5 0 0 1 4 3
.00951611 1 0 0 1 3 0 5 0 1 1 4 3
0 1 0 0 2 3 0 1 0 0 1 2 3
0 0 0 0 2 3 0 5 0 1 0 2 1
0 0 0 1 2 3 0 1 0 0 0 1 3
0 0 0 1 2 2 0 3 0 0 0 3 1
.02071823 1 0 0 2 3 1 3 1 1 1 2 3
0 1 0 0 2 3 0 3 0 1 1 2 3
.10893247 0 0 0 2 3 1 3 0 0 0 1 1
.00540276 1 0 0 3 1 0 3 0 1 1 2 4
.001699293 1 0 0 4 3 0 1 0 0 1 3 3
.0029537205 1 0 0 4 4 1 5 0 0 1 3 3
.05338598 1 0 0 3 3 1 4 1 1 1 1 3
.001384535 1 0 0 1 2 0 4 0 1 1 1 3
.012099246 1 0 0 1 2 0 4 0 0 0 4 4
.8439155 1 0 0 2 3 0 5 0 0 1 1 1
0 0 0 1 4 3 0 4 0 0 1 2 1
.004110477 1 1 0 1 3 1 1 0 1 1 2 4
.01130746 1 0 0 1 3 0 5 0 1 1 2 4
.004008539 1 0 0 1 3 1 3 1 0 1 3 4
0 0 0 0 2 3 0 4 0 0 0 2 3
.004610162 1 0 0 1 4 1 5 1 1 1 4 4
.05020221 1 0 0 3 3 0 3 0 0 0 2 2
0 0 0 1 3 3 1 2 1 0 0 2 2
.0020562997 1 0 0 4 3 0 5 0 0 0 2 2
0 0 0 0 2 3 0 1 0 0 0 1 1
.017711425 1 0 0 2 3 0 3 0 0 0 1 1
0 0 0 0 2 3 0 1 0 . 0 1 1
.013680274 1 0 0 1 3 1 4 1 0 0 3 1
.0292491 1 1 0 4 2 0 1 0 1 1 3 1
.0445552 1 0 0 1 4 1 3 1 1 0 3 4
.007221488 1 0 0 1 3 0 1 0 1 0 3 4
.014167874 1 0 0 1 3 0 5 0 1 1 3 4
0 0 0 0 1 3 0 3 0 1 0 2 2
.04431479 1 0 0 1 4 0 4 0 0 0 3 4
.016026935 1 0 0 1 4 1 5 1 . 1 3 4
.02799761 1 0 0 1 4 1 4 1 1 0 2 3
.01935859 1 0 0 1 3 0 3 0 0 0 2 3
0 1 0 0 1 2 0 3 0 1 1 2 2
0 1 0 0 1 3 0 2 0 0 1 1 4
.00057418464 1 0 0 3 3 0 3 0 . 0 1 1
0 0 0 1 2 3 0 4 0 1 0 1 2
0 0 0 0 1 3 0 1 0 0 0 1 1
.018763967 1 0 0 1 3 1 4 1 1 1 3 3
.00919189 1 0 0 1 3 1 3 0 . 0 2 3
0 0 0 0 1 3 0 3 0 1 0 1 4
.0022878346 1 0 0 1 4 1 1 1 0 1 3 3
.0089355465 1 0 0 1 3 1 5 1 1 0 4 4
.002441883 0 0 0 1 3 1 5 0 0 1 2 4
.01016793 1 0 0 1 1 0 5 0 1 1 2 4
0 0 0 1 1 3 1 2 0 0 0 2 2
.017079419 1 0 0 3 2 0 1 0 0 0 2 2
0 0 0 0 1 4 1 1 0 0 1 2 3
.015497336 1 0 0 1 4 0 4 0 0 0 1 2
0 0 0 1 2 3 0 3 0 0 0 1 1
0 0 0 0 2 3 1 2 0 1 0 1 1
0 0 1 1 2 3 1 3 0 1 0 1 2
0 0 0 0 2 3 0 4 0 0 0 1 1
.0003999116 1 0 0 2 3 1 4 1 0 1 4 2
.0004577078 1 1 0 2 1 0 4 0 0 1 4 2
.007543103 1 0 0 2 3 1 1 0 1 0 2 2
0 0 0 1 1 3 1 1 1 0 0 3 4
.03690508 1 0 0 1 3 0 1 0 0 0 3 4
0 0 0 1 2 3 1 1 1 . 0 1 2
0 0 0 0 2 2 0 3 0 1 0 2 3
0 0 0 1 1 2 0 3 0 . 0 2 1
0 0 1 1 1 3 1 4 0 1 0 3 3
0 0 0 0 1 2 0 3 0 1 0 3 3
.010373444 1 0 0 1 3 0 4 0 1 1 1 1
0 0 0 0 1 3 0 3 0 0 0 2 3
0 0 0 0 1 3 0 1 0 1 0 1 1
end
label values r11dentst YESNO
label def YESNO 0 "0.no", modify
label def YESNO 1 "1.yes", modify
label values inc_d inc_d
label def inc_d 0 "No", modify
label def inc_d 1 "Yes", modify
label values endentulism endentulism
label def endentulism 0 "No", modify
label def endentulism 1 "Yes", modify
label values race race
label def race 1 "White", modify
label def race 2 "Black", modify
label def race 3 "Hispanic", modify
label def race 4 "Other", modify
label values age_cat age_cat
label def age_cat 1 "50-59", modify
label def age_cat 2 "60-69", modify
label def age_cat 3 "70-79", modify
label def age_cat 4 "80+", modify
label values male male
label def male 0 "Female", modify
label def male 1 "Male", modify
label values education EDUC
label def EDUC 1 "1.lt high-school", modify
label def EDUC 2 "2.ged", modify
label def EDUC 3 "3.high-school graduate", modify
label def EDUC 4 "4.some college", modify
label def EDUC 5 "5.college and above", modify
label values veteran veteran
label def veteran 0 "No", modify
label def veteran 1 "Yes", modify
label values mothered mothered
label def mothered 0 "Less than High School", modify
label def mothered 1 "High School or Higher", modify
label values dentalinsurance_w1 dentalinsurance_w1
label def dentalinsurance_w1 0 "No", modify
label def dentalinsurance_w1 1 "Yes", modify

Comment