# st: calculating XfBm after -oaxaca-for male and female

 From "Mandy fu" To statalist@hsphsun2.harvard.edu Subject st: calculating XfBm after -oaxaca-for male and female Date Tue, 4 Nov 2008 15:16:25 -0500

```Hi all,

After -oaxaca- for wages of male and female, I want to calculate XfBf
(predicted wage of female)and XfBm(How much would a female earn if she
was treated exactly the same as a male in labor market). Where , Xf
means the factors affecting wages of female; Bm means the coeffcients
of factors affecting male wage.
I use the following way to do the calculation. But I need to figure
out what numbers should be selected fromt he matrix to get XfBm . So
it takes quite a while to do all teh work when there are lots of
oaxaca decompositions to do.
So , I was wondering if anyone could give me some idea if there's any
easier way to do this. Sorry for bring up the details. It'll be
helpful if you give some hints of where I could revise.
Thanks for yur help!
--------------------------------after oaxaca compute XfBf, XfBm. ( m:
male ; f:female)
.oaxaca lnwage x1-x17, by (female) weight(1)
.matrix b=e(b)
.matrix b0=e(b0)
.matrix list b
.matrix list b0
*b is a matrix [1,40]
*b [1 predict_male, 1 predict_female, 1 difference,17 explained,
total_explained, 17 unexplained,1constant, 1 total_unexplained]
*b0 is a matrix 1*72.
*b0 [17 coefficents_male, 1 constant,17 coeffcients_female,1 constant,
17 X values_male ,1 constant,17 X values_female,1 constant]

*select the second number in b as XfBf:
.matrix XfBf=b [1,. . ., 1 . . 2]
*select the number 1-18 in b0 as Bm.
.matrix Bm=b0[1 . . . , 1 . . 18]
*select the number 55-72 in b0 as Xf.
.matrix Xf=b0[1 . . . , 55 . . 72]
*calculate Xf*Bm.
.matrix XfBm=Xf*Bm'
.svmat XfBm
display XfBm
--------------------------------------------------------------------------
Thanks!
Mandy
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```