Hi Christine.
The problem you are running into is that adjust isn't really designed to do something as complicated as you are trying to do.
There are a number of user written commands that automate the process of doing wage decompositions. It is likely that one of these does what you are looking for - try findit "smithwelch", "jmp" , "oaxaca", "decompose", "jmp2".
The other option is to use predict to do this by hand. one great feature of predict is that you can change datasets and still make predictions based on the last estimated model. So, all you need to do is set up a fake dataset (or add these as extra observations to your current dataset) with the values of the X variables that you want to use in your predictions and then run the appropriate regression model, change datasets, and use predict to create the appropriate fitted values.
Hope this helps.
Cheers,
Steve
-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Christer
Thrane
Sent: Saturday, August 26, 2006 4:02 AM
To: [email protected]
Subject: st: Regression and "what-if" predictions
Hi,
The variables in my panel regression model are:
logwage (log of annual wage)
male (male=1, female=0)
edlevel (5 levels of education)
exp (working experience)
expsq (working experience squared)
year (1994=0, 1995=1, ... 2002=8)
married (married=1, unmarried=0)
nrchild (number of children)
The first prediction I'm interested in is the:
(i) log wage for a married male with edlevel = 3 in 2002 with average number
of children and working experience.
To obtain this, I use the code:
xi: xtreg logwage i.edlevel exp expsq year /*
> */ married nrchild if male==1, re cluster (lpnr)
and
adjust _Iedlevel_2=0 _Iedlevel_3=1 _Iedlevel_4=0 _Iedlevel_5=0 /*
> */ exp expsq year=8 married=1 nrchild if male==1
This seems to work well.
The second prediction I'm interested is analogues to (i), but now I want to
answer the question, What would be "the same" male's logwage if he had
female averages on the various independent variables in the model?
To obtain this second prediction (ii), I simply replace the "male==1" with
"male==0" in the -adjust- command, as in:
adjust _Iedlevel_2=0 _Iedlevel_3=1 _Iedlevel_4=0 _Iedlevel_5=0 /*
> */ exp expsq year=8 married=1 nrchild if male==0
This also seem to work well. At least exp, expsq and nrchild are given the
female's averages, but I'm not sure of whether the effect of married and
year are evaluated at the female's averages here.
Now comes the tricky part, i.e. the two predictions I don't know how to get:
(iii) What would "the same" male's logwage if he had male averages on the
various independent variables, but the female's xt regression coefficients?
(iv) What would "the same" male's logwage if he had female averages on the
various independent variables, but the female's xt regression coefficients?
At some point this, I think, involves the regression:
xi: xtreg logwage i.edlevel exp expsq year /*
> */ married nrchild if male==0, re cluster (lpnr)
to obtain the female's xt regression coefficients, but I can't seem to
figure out how to "force" the female's coefficients onto the male sample.
Any help is appreciated!
Best regards,
Christer Thrane
Lillehammer University College
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/