Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: differences of mean

From   Chiara Mussida <[email protected]>
To   statalist <[email protected]>
Subject   st: differences of mean
Date   Tue, 27 Mar 2012 13:41:18 +0200

Dear All,
I have to calculate the difference of mean log wages of men and women.
My dataset contains the variable lwage which is the log of wages. I
tried to generate the mean wage (also by occupation, for a more
detailed difference):

bys occupation: egen wage=mean(lwage)
ge wage1f=wage if occupation==1 & fem==1
ge wage1m=wage if occupation==1 & fem==0
ge diff1=wage1m - wage1f if occupation==1

but this gave me a variable diff1 with no observations, since the mean
lwage for men is missing when the mean lwage for men it is not, and
viceversa. Again, if I do replace the missing values of men and women
with 0 this gives me false results (I know there is a difference
between missing and 0).

How should I get my variable diff= mean(lwage men) - mean(lwage
women)? Total difference and/or difference by occupation.

Thanks a lot

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index