# Re: st: Fixed effects with a 'future-lagged' variable

 From Anna Reimondos To statalist@hsphsun2.harvard.edu Subject Re: st: Fixed effects with a 'future-lagged' variable Date Sun, 15 Feb 2009 12:22:11 +1100

```Dear Austin,
Thanks you for your helpful comments!  Just to give you some more
information about what I am trying to do, the attitude I am measuring
is desire to have a child (score of 0-10) and I actually have
relatively large N (just over 3,000) and small T (unbalanced panel-
between 3-6 years).
I tried your suggestion about mapping the trajectory, using dummy
variables indicating whether this was the first, second, third etc
year after the child was born. That is just the thing I wanted to do.
My thinking in using fixed-effects xtreg (I have also tried xtlogit,
splitting the scores of 0-10 into two groups, one high and one low)
was that I could control for unobserved heterogeneity and come at
least a bit closer to finding a causal relationship I.e there may be
some unobserved characteristics that make some people more likely to
have children, and these characteristics are likely to be correlated
with the other variables in the model but by using fixed effects and
only focusing on within-individual variation we control for that?   I
tried the glm suggestion too, but that still treats all the
observations as separate and does not take into account that they are
clustered within individuals?
I have a feeling I am missing the plot here....

Thanks again for your help,
Anna

On Sat, Feb 14, 2009 at 4:58 AM, Austin Nichols <austinnichols@gmail.com> wrote:
> Anna Reimondos <areimondos@gmail.com>:
> First of all, birth is not exogenous to attitude (what is that
> variable supposed to measure, anyway?).  Second, you cannot use
> -xtreg- blindly with a (discrete?) bounded dependent variable.  You
> might get some traction by switching to GLM and redefining attitude as
> a number between 0 and 1, and regressing y on c0=child born this year,
> c1=child born last year, etc. to map out the time path of attitude
> change after birth.  But you still should find some exogenous
> variation in birth before concluding there is any causal relationship
> (and exogenous variation in first birth is notoriously difficult--for
> later births there are some instruments out there).
>
> tsset ID Year
> bys ID (Year): assert child[1]==0
> by ID: g c0=(child==1 & l.child==0) if !mi(child)
> forv i=1/9 {
>  bys ID (Year): g c`i'=l.c`=`i'-1'
> }
> egen csum=rowtotal(c?)
> g clater=child-csum
> g y=attitude/10
> qui tab ID, g(_i)
> glm y c? clater _i*, link(logit) fam(bin) r
>
> What N and T do you have in this panel data? I have implicitly been
> assuming you have few people over long periods of time.
>
> See also http://www.stata.com/support/faqs/stat/logit.html on -glm- in
> this context.
>
> On Thu, Feb 12, 2009 at 11:15 PM, Anna Reimondos <areimondos@gmail.com> wrote:
>> Hello,
>> I have fixed effects question I was hoping I could get some help with.
>> I am estimating a model that looks at changes in attitudes within
>> individuals over time. I am focusing on individuals who have never had
>> a child, and I am interested in seeing how attitudes (measured on a
>> scale from 0 -10 ) change after the birth of a child.
>>
>> e.g xtreg attitude child etc, fe
>>
>>  I except that attitudes increase slightly after the birth of the
>> first child, but looking at the data I see that the year the child is
>> actually born, attitudes fall quite dramatically, but they  do pick up
>> once the child gets past the first year of age surpassing what they
>> were before the birth. An example would be (with the data in long
>> format):
>>
>> ID   Year       Child   Child (f-lagged)  Attitude
>> 1     2001        0          0                     8
>> 1     2002        0          0                     7
>> 1     2003        1          0                     2
>> 1     2004        1          1                     9
>> 1     2005        1          1                    10
>>
>>
>> In my model I would like to exclude the first year from entering into
>> the estimation of the effect of having a child because this makes the
>> coefficient for the dummy variable describing whether there is a child
>> negative.  I tried to this by having a 'future lagged' variable which
>> is only equal to 1 if it is at least one year after the birth of the
>> child (to avoid including the dramatic drop just around the birth of
>> the child). (see example).
>>
>> As I understand fixed effects models, they work by de-meaning the
>> data, so the mean of all the predictors and the dependent variable is
>> worked out for each individuals and then at each time point the
>> observed value is compared with the mean. I am worried that by doing
>> this, i.e by using the future-lagged variable instead of the normal
>> child variable, I am pushing the low value just around childbirth
>> (value of 2 in year 2003) in this case to the wrong side of the dummy
>> variable artificially making it look like there is a greater positive
>> change after childbirth than before.
>> Would it be better to just drop the year out of the analysis
>> completely? I am worried about  doing this since then I will lose
>> possible variation in other time-varying variables I am interested in.
>> Would a dummy variable, which is only equal to 1 for the year the
>> child was born make more sense instead?
>>
>> I hope this question makes sense.
>> Any advice would be greatly appreciated.
>>
>> Anna
> *
> *   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/
```