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: RE: Creating a time lag dummy
From
Martijn S <[email protected]>
To
[email protected]
Subject
Re: st: RE: Creating a time lag dummy
Date
Tue, 10 May 2011 20:42:08 +0200
Sorry for this misclassification. I used your code and added an if
fuction and it works!
Thanks a lot!
2011/5/10 Nick Cox <[email protected]>:
> We can't comment on your code, and thus on what you got wrong, if you don't show any. You could do something like this:
>
> gen byte IPO5 = inrange(fyear - year_ipo, 1, 5)
>
> Please use Stata terminology: variables not columns!
>
> Nick
> [email protected]
>
> Martijn S
>
> I have a problem generating a 'special' dummy. This is my problem. I
> have the following columns fyear and year_ipo. Now I want to create a
> dummy which gives a 1 when a company has gone public in the prior 5
> calendar years and a 0 otherwise.
>
> So for example, I have a company which had an IPO in 1999. So this
> dummy should create a 1 for the fiscal year 2000,2001...,2004 and a zero
> for 2005,2006...2010.
>
> Unfortunately I cannot get the dummy working.
>
>
> *
> * 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/