Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: RE: RE: estimation with a time trend.

 From natasha agarwal To statalist@hsphsun2.harvard.edu Subject Re: st: RE: RE: estimation with a time trend. Date Mon, 5 Jul 2010 17:24:26 +0100

```On Mon, Jul 5, 2010 at 4:49 PM, Maarten buis <maartenbuis@yahoo.co.uk> wrote:
> --- On Mon, 5/7/10, natasha agarwal wrote:
>> I wanted to introduce a time trend in my estimation where
>> my years go from 2001-2005.
>>
>> With time trend I mean:
>>
>> panel identifier    year      time trend
>> 1                   2001        1
>> 1                   2002        2
>> 1                   2003        3
>> 1                   2004        4
>> 1                   2005        5
>> 2                   2001        1
>> 2                   2002        2
>>
>> The only way I knew how to do it was to use the egen
>> -group- command.That is why I wanted to do the egen
>> -group- command.
>
> I am still confused: What is "time trend" supposed to
> measure that cannot be measured with "year"? Given your
> earlier remarks you did not think that "the 0 outside the
> range of your data" was a problem in your fixed effects
> model. So what problem did you want to solve by creating
> that "time trend" variable?

The time dummies are highly collinear with one of my variables in the
model. However, exclusion of the same would lead to an error as we
wanted to control for business cyclical effects. For the very reason,
we decided to introduce a rough measure of time dummies that would b a
trend. This is the problem I wanted to solve by creating the time
trend variable and introduce the same in my estimation.

> Mind you, I don't think it is a bad idea to ensure that
> 0 happens at a meaningful point in time, but it does not
> seem to be the problem that you wanted to solve. We need
> to make sure we understand what the problem is you want
> to solve before we can help.
>
> Again, there is no need to use -egen group()-, and it is
> dangerous as your year variable may be unequally spaced
> (even if you think that it is not, real data has the
> nasty property of always deviating from what you think
> should be true in your data...).  You could easily check
> it before hand, but there is an easier and much saver
> solution: just subtract a constant:
>
> *--------- begin example --------
> drop _all
> input id  year
>      1   2001
>      1   2002
>      1   2003
>      1   2004
>      1   2005
>      2   2001
>      2   2002
> end
> gen trend = year - 2000
> list
> *--------- end example ----------
> (For more on examples I sent to the Statalist see:
> http://www.maartenbuis.nl/example_faq )
>
> To repeat: do not use -egen group()- for this purpose,
> it is dangerous. It will work in this example, but it
> can just too easily backfire in real data.
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
> http://www.maartenbuis.nl
> --------------------------
>
>
>
>
> *
> *   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/
```