Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Re: RE: Re: RE: calculating gender wage ratioes for different levels of education


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: RE: Re: RE: calculating gender wage ratioes for different levels of education
Date   Thu, 7 Sep 2006 17:43:41 +0100

Cancel everything else so that you can read [U] 18 this evening! 

Nick 
[email protected] 

Christer Thrane
 
> Thanks, Scott, this seems to work very nicely (although I do 
> not understand 
> much of what's going on in your command).

Scott Merryman
 
> > Here is one way in which the ratios are store as locals:
> >
> > sysuse auto,clear
> > recode rep 1/3=3
> > drop if rep==.
> >
> > levelsof rep , local(levels)
> > foreach l of local levels {
> > forv  j = 0/1 {
> > qui sum price if rep == `l' & fore == `j', meanonly
> > local p_`l'_`j' = r(mean)
> > }
> > local ratio`l' = `p_`l'_0'/`p_`l'_1'
> > }
> > macro list _ratio3 _ratio4 _ratio5

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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index