Bookmark and Share

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


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

Re: st: Re: Lag variables


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Lag variables
Date   Wed, 6 Mar 2013 10:28:37 +0000

Your variable -SIZE- is necessarily missing whenever -year- is not
1991. It may be that you want instead something more like

egen SIZE1991 = total(employment / (year == 1991)), by(firmid)

See

SJ-11-2 dm0055  . . . . . . . . . . . . . .  Speaking Stata: Compared with ...
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        Q2/11   SJ 11(2):305--314                                (no commands)
        reviews techniques for relating values to values in other
        observations

for a review of related technique.

Nick

On Wed, Mar 6, 2013 at 4:32 AM, Alice Jones <alicejones07@googlemail.com> wrote:

> I am analysing firm performance on a balanced panel over a period of 9
> years. I create a variable SIZE which measures firm size in the first
> year of the sample period and regress this against firm performance
> over the 9 year period.
>
> I run the following command to create the size variable:
>
> gen SIZE = employment if year==1991
>
> However, when I run the regression:
>
> reg GROWTH SIZE
>
> I get the error message, No observations.
>
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index