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: Lagged variables query


From   "Mirnezami, Oliver" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Lagged variables query
Date   Tue, 9 Apr 2013 13:02:41 +0000

Thank you for your suggestion Nick to use the l.operator. Would appreciate if anyone could offer any advice though on whether it does make sense to use lag operators in the conventional way or if my alternative idea of keeping the control group fixed and just adjusting the treatment group would be better? I'm not looking for specialist advice from a health perspective as my project is an economics one. Just clarification on the construction of treatment and control groups when using lagged operators would be very helpful. Thank you. 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: 09 April 2013 13:43
To: [email protected]
Subject: Re: st: Lagged variables query

As you have panel data, you should -xtset- or -tsset- your data and define lagged variables using the L. operator.

Using subscripts to define lagged values as you have done, or propose to do, risks errors if there are gaps in your data, and indeed complete nonsense if the lagged value for one panel is in fact taken to be some value for a different panel.

This isn't the question you asked -- which I haven't tried to understand, as if it's a matter of what people do in a field not my own -- but it's a crucial detail.

Nick
[email protected]


On 9 April 2013 13:29, Mirnezami, Oliver <[email protected]> wrote:
> Hi
>
> I'm investigating the effect of job loss on health in a panel dataset. I have an OLS model with individual fixed effects, year effects and a set of explanatory variables with health as the dependent variable. The main independent variable of interest is a treatment indicator variable that = 1 for the treatment group (individuals that have experienced job loss in the current wave) and = 0 for the control group (individuals that are employed in the current wave).
>
> My query is regarding the logic for analysing the lagged effect of job loss.
>
> I've used the following code to generate lags in what I would consider to be the 'normal way' in that everything is just shifted one period:
>
> forvalues i = 1/8 {
> qui gen treatlag`i' = .
> qui by id: replace treatlag`i' = treat [_n-`i'] }
>
> The issue is that then the zeros (control groups) are no longer just assigned to the periods in which an individual is necessarily employed and so I am not sure whether it makes any sense to investigate this in this manner? This is exacerbated by the fact that my dataset is an unbalanced panel and since it is a health and retirement survey, there are a relatively large number of periods in which individuals are not in the labour force. I'm concerned that by shifting the zeros in this way, my control group is changing and so includes individuals who are not employed but may be retired for example and so the comparison isn't as 'clean' as the original unlagged treatment effect where I distinguish between employed individuals and those that have reported job loss in the current wave.
>
> The other idea I had was to essentially keep the control group for the lagged variables the same as for the main unlagged treatment variable (i.e. keep the position of the 0s as they were) and just shift the treatment values (i.e. just move the 1s):
>
> forvalues i = 1/8 {
> qui gen treatlagg`i' = .
> qui by id: replace treatlagg`i' = 0 if (treat ==0) qui by id: replace 
> treatlagg`i' = 1 if (treat[_n-`i']) ==1 }
>
> I've had limited experience in dealing with lagged variables but have a feeling this is less of a conventional case so any advice on which approach (if any) makes sense would be much appreciated.
>
> Kind regards
>
> Oliver
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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