Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: The Current Population Survey

From   Daniel Egan <[email protected]>
To   [email protected]
Subject   Re: st: The Current Population Survey
Date   Mon, 31 Jan 2005 07:45:44 -0500

> I would like to calculate the employment/labor force ratio
> for each state during some period of time.
> Let's say I have the (NBER's) MORG file for each year
> 1980 - 1990 (11 seperate files, 1 file for one year). 
> I think can calculate the employment/labor force ratio for each
> year (for each state) in each file by counting the number of employed 
> people divided by the number of people in labor force (by state). 
> But how can I put the numbers together in another file?
> I mean I want to generate a file that has the data like this:
> State  Year  Emp/Labor
> CA     1980   xxxx
> CA     1981   xxxx
> ....      ....     .....

Unless I am misunderstanding the nature of your question, this is
simply a matter of doing it for each year, and then appending the
datasets. If those three are the only variables you want, then.

*open each years data
bys state: gen lfpr=emp/labor
keep state lfpr
gen year = (whatever year).
sort state year
save 1980_lfpr.dta (for example).
.... for each year

use 1980_lfpr.dta
append using 1981_lfpr.dta
append using 1982_lfpr.dta
an so on. 

Hope this helps, 

*   For searches and help try:

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