I am using oaxaca8 package along along with the rifreg and I want to separate the unexplained part of the decomposition between the two groups. I try the split option like in simple oaxaca command but it doesn't work. I would need your help. Thanks in advance.
Announcement
Collapse
No announcement yet.
X

Hi Alphonse,
Unless you are trying to do a reweighted RIF regression, I think your best option is to do as follows:
1. Create the corresponding RIF that you want to do the analysis for, one for each group.
2. Create a single variable using the two new variables you just created.
3. Run a standard Oaxaca using the variable you created in 2 as your outcome/dependent variable.
Hope this helps
FR

Hi Fernando,
Thank you for your answer. Here is my coding:
/*Step 1: RIF regression */
forvalues q=10(10)90{
quietly xi: rifreg y $gender_var if manager == 0, quantile (`q') retain(rif_m`q')
estimates store malemed`q'
quietly xi: rifreg xi: rifreg y $gender_var if manager == 1, quantile (`q') retain(rif_f`q')
estimates store femalemed`q'
/*Step 2: For each quantile result, use oaxaca8 to compute the decomposition */
oaxaca8 malemed`q' femalemed`q', weight(1) asis detail esave
}
My problem for this twofold decomposition is that I cannot use the split option in Step 2 to get the unexplained part for each group as we can do with oaxaca. Any help.
Thanks
Alphonse
Comment

Here is what I have done in the past:
Code:forvalues q=10(10)90{ capture drop rif_y quietly rifreg y if manager == 0, quantile (`q') retain(rif_m`q') quietly rifreg y if manager == 1, quantile (`q') retain(rif_f`q') gen double rif_y=rif_m`q' if manager == 0 replace rif_y=rif_f`q' if manager == 1 /*Step 2: For each quantile result, use oaxaca8 to compute the decomposition */ oaxaca rif_y $gender_var, by(manager) w(1) detail est sto rifob_`q' } est tab rifob *
Comment

Dear FernandoRios ,
I am using OaxacaBlinder method to decompose difference in log expenditure between farm and nonfarm household. Thanks to your code above, I could run my model. But I didn't know how to interpret the result when the difference were not statistically significant at all selected quantiles. Here is the result at median, for instance. Can I conclude that there were no statistically significant differences in expenditure between two group?
Code:quietly rifreg lnexpenditure if non == 1, quantile (50) retain(farm_50) quietly rifreg lnexpenditure if non == 0, quantile (50) retain(nonfarm_50) gen rif_50=farm_50 if non == 1 (1,125 missing values generated) replace rif_50=nonfarm_50 if non == 0 (1,125 real changes made) oaxaca rif_50 age ethnicity education householdsize proportion15 proportion65 lnfor_remittance lndomes_remittance lnincome, by(non) pool > ed detail BlinderOaxaca decomposition Number of obs = 1,389 Model = linear Group 1: non = 0 N of obs 1 = 1125 Group 2: non = 1 N of obs 2 = 264   Robust rif_50  Coef. Std. Err. z P>z [95% Conf. Interval] + overall  group_1  9.764274 .0189733 514.63 0.000 9.727087 9.801461 group_2  9.776749 .0352508 277.35 0.000 9.707658 9.845839 difference  .0124751 .0400325 0.31 0.755 .0909374 .0659872 explained  .0692789 .0311194 2.23 0.026 .008286 .1302718 unexplained  .081754 .0428163 1.91 0.056 .1656724 .0021643 + explained  age  .0052687 .008701 0.61 0.545 .0223224 .0117849 ethnicity  .0007483 .0013084 0.57 0.567 .0033126 .0018161 education  .031386 .0093691 3.35 0.001 .013023 .0497491 householdsize  .0430033 .010735 4.01 0.000 .0640436 .021963 proportion15  .0077162 .0047679 1.62 0.106 .0170612 .0016287 proportion65  .000435 .0080418 0.05 0.957 .0153266 .0161966 lnfor_remittance  .0000266 .0043033 0.01 0.995 .0084078 .008461 lndomes_remittance  .0022431 .0023976 0.94 0.349 .0069424 .0024561 lnincome  .0964109 .0269999 3.57 0.000 .0434922 .1493297 + unexplained  age  .1637974 .1949282 0.84 0.401 .5458497 .218255 ethnicity  .0137441 .0111754 1.23 0.219 .0081592 .0356474 education  .0688098 .0672642 1.02 0.306 .0630256 .2006452 householdsize  .0379496 .1020713 0.37 0.710 .1621066 .2380057 proportion15  .0907804 .0441929 2.05 0.040 .0041639 .177397 proportion65  .057662 .0241633 2.39 0.017 .0103028 .1050212 lnfor_remittance  .0145628 .0081214 1.79 0.073 .0013548 .0304804 lndomes_remittance  .003499 .0600728 0.06 0.954 .1142414 .1212395 lnincome  2.542524 .741905 3.43 0.001 1.088417 3.996631 _cons  2.747489 .8012333 3.43 0.001 4.317877 1.1771 
Nhi
Comment

Hi Nhi
Three comments
1. I would interpret the data as evidence suggesting no difference across groups in terms of medians, but some evidence that this is because of an interaction and compensation between endowments and coefficient effects, which are different
2. The standard errors are possibly incorrect since the recommendation is to bootstrap the whose process to obtain correct standard errors when using quantiles as outcome. Search for the latest publication by fFortin Firpo and Lemieux on using Rifregressions for wage decomposing
3. Look in the scc archive for the program oaxaca_rif. Its a new contributed program that I prepared to elaborate the rif decomposition that can be easily used to get bootstrapped standard errors. Look into the last example in the help file
best,
Fernando
Comment

Hi Fernando,
Thank you for your recommendation of the latest publication by Firpo et al.(2018) and oaxaca_rif command. Literatures show that using group 0 or group 1 as the reference group dose not involve any specific estimation issues. But I've wondered which one I should choose, so I ran both of them. It seems like that there are differences between 2 models which have different reference group. The result below is too long but if you could please have a look on it. Is there any criterion showing which group should be used as the reference group. And could you give me some advices on interpreting this result, that is not statistically significant at all selected quantiles?
results.txt
Best regards,
Nhi
Comment

Hello Fernando.
Glad i could find you here! I am trying to decompose immunization inequality (using the Erregyers index)among Ugandan children aged 1223 months! I am not very conversant with RIF functions but i followed through your paper and managed to write the code in my do file. However it did not return any result and brought an error with "option robust not allowed". I thought its the version of oaxaca_rif that i had that wasn't update however checking for updates, i was told package was no longer available.
oaxaca_rif at http://fmwww.bc.edu/RePEc/bocode/o:
package no longer available
This is the code and the result i got.
. //RIF decomposition
. oaxaca_rif immunstat `x' weight, by(v102) rif(eindex(immunstat) lb(0)ub(1)) rwlogit(`x')
No wgt specified. Using default 0
No Reweighted Strategy Choosen
Estimating Standard RIFOAXACA using RIF:eindex(immunstat) lb(0)ub(1)
option robust not allowed
Note: `x' is a gloabal for indepedent variables, immunstat is the depedent variable with 0=fully immunised and 1=not fully immunised.
I am therefore seeking your help
Comment

I just realized something else. Erregyers index is a type of concentration index that needs to be used with a continuous ranking variable.
THe they you have it set up right now its eindix(inmunstat), but it should be something like eindex(income).
Otherwise, i dont think the index will capture what you have in mind.
Best
Fernando
Comment
Comment