Statalist


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

AW: st: Re: Re: how to calculate employment history - panel data


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: Re: Re: how to calculate employment history - panel data
Date   Fri, 29 May 2009 09:34:14 +0200

<> 

I hope you can take it from here, with the added help of Nick`s
http://www.stata-journal.com/article.html?article=dm0029




HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von go.diva@web.de
Gesendet: Donnerstag, 28. Mai 2009 23:06
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: Re: Re: how to calculate employment history - panel data

First of all thanks a lot! It is definitely a good start. 

But, if I set in your code the window instead of "begin-6" to a longer
period, say "begin-31" than the window will be overwritten by the previous
employment spells. In addition, it also does not count the number of weeks
correctly until a previous emloyment spells starts.

Does somebody see a solution to the problem?  



_______________________
----- Original Message ----- 
From: "Martin Weiss" <martin.weiss1@gmx.de>
To: <statalist@hsphsun2.harvard.edu>
Sent: Thursday, May 28, 2009 12:32 AM
Subject: st: Re: how to calculate employment history - panel data


><>
>
> -egen- happily accepts expressions for some of its functions, so let`s try

> and use that...
>
> ***
>
> clear*
>
> input Id   spell  begin  end     status:mylabel , auto
> 1    1       12        14       empl
> 1    2       15         46      unempl
> 1    3       47         52      sick
> 1    4       59         66      unempl
> 1    5       70         80      empl
> 1    6       81         88      unempl
> 1    7       89        105     empl
> 2    1       14         21      unempl
> 2    2       55         59      sick
> 2    3       61        109     empl
> 2    4      110       115     unempl
> 2    5      116       200     empl
> end
> compress
>
> bys Id: gen byte newspell=sum((status[_n-1]==1)*(_n!=1))
> bys Id newsp: egen window=total((begin-6)*(_n==_N)*(_n!=1))
> bys Id newsp: /*
> */egen weeks=total((status==2)*/*
> */(begin<=window)*(end>=window)*/*
> */(end-window))
> l, sepby(Id news)
> ***
>
>
> HTH
> Martin
> _______________________
> ----- Original Message ----- 
> From: <go.diva@web.de>
> To: <statalist@hsphsun2.harvard.edu>
> Sent: Wednesday, May 27, 2009 11:22 PM
> Subject: st: how to calculate employment history - panel data
>
>
>>
>> I have the following panel dataset:
>>
>> Id   spell  begin  end            status
>> 1    1       12        14              empl
>> 1    2       15         46             unempl
>> 1    3       47         52             sick
>> 1    4       59         66             unempl
>> 1    5       70         80             empl
>> 1    6       81         88             unempl
>> 1    7       89        105            empl
>> 2    1       14         21             unempl
>> 2    2       55         59             sick
>> 2    3       61        109            empl
>> 2    4      110       115            unempl
>> 2    5      116       200            empl
>>
>>
>> I want now to calculate for each spell and person how many weeks the 
>> person has been e.g. unemployed during the past 31 weeks (6 month) when 
>> he/she enters employment.
>>
>> The problem is not to calculate the entire weeks spent in unemployment 
>> but only the number of weeks during a fixed period of time.
>>
>> Any help or hint would be welcome.
>>
>> Thanks
>>
>>
>>
>> ____________________________________________________________________
>> Neu: WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
>> Telefonanschluss für 17,95 Euro/mtl.!* http://produkte.web.de/go/02/
>>
>>
>> *
>> *   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/
> 

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



_______________________________________________________________________
Nur bis 31.05.: WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate
und Telefonanschluss für 17,95 Euro/mtl.! http://produkte.web.de/go/02/


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index