Bookmark and Share

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]

Re: st: differences of mean


From   Richard Herron <[email protected]>
To   [email protected]
Subject   Re: st: differences of mean
Date   Tue, 27 Mar 2012 07:53:16 -0400

Have you tried -ttest lwage if (occupation == 1), by(fem)- ?

I think this should work.

Richard Herron



On Tue, Mar 27, 2012 at 07:41, Chiara Mussida <[email protected]> wrote:
> 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
>
> Chiara
> *
> *   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/

*
*   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/


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