Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Making Sense of the Counterfactual Decomposition of Differences in Distribution Example from the Helpfile
From
Joseph Kwan <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Making Sense of the Counterfactual Decomposition of Differences in Distribution Example from the Helpfile
Date
Mon, 22 Jul 2013 23:30:31 +0000
The command is cdeco
My Question is for this type of decomposition, firstly, why do I need to set the number of observations and why do I need to set the seed?
secondly do I have to convert my variable to the format similar to the example below, using some sort of uniform or cumulative normal distribution.
I wonder if anyone can kindly explain the meanings of the commands of the example below, especially relating to what the uniform and invchi12 and invnormal means.
If I have numeric variables, such age, earnings, years of work experience and hourly salary, would that command work even if I do not covert it to some sort of distribution as in the example below.
Please help.
*Set the number of observations and the seed
clear
set obs 1000
set seed 1
*Generate female, experience and lwage
generate female=(uniform()<0.5)
generate experience=4*invchi2(5,uniform())*(1-0.4*female)
generate lwage=2+experience*0.03 ///
-0.1*female+invnormal(uniform())*0.5
*Decomposition of the median difference in lwage between men and women.
*First using quantile regression
cdeco_jmp lwage experience, group(female) quantile(0.5) noboot
*Second using the location model (OLS)
cdeco_jmp lwage experience, group(female) quantile(0.5) noboot method(loc)
*Interpretation: the results are similar using either method because
*the residuals are independent from experience.
*The observed median gender gap is about 40%.
*About 28% is explained by gender differences in the distribution of experience.
*About 11% is due to differing median coefficients between men and women.
*The part due to the residuals is negligible.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/