Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Help Creating a Lagged Variable - REVISED


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: Help Creating a Lagged Variable - REVISED
Date   Tue, 12 Sep 2006 16:43:30 -0400

How about subtraction?

gen yearselapsed=year-regimechangeyear

M Blasnik

----- Original Message ----- From: "Michael Horowitz" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 12, 2006 4:30 PM
Subject: Re: st: Help Creating a Lagged Variable - REVISED



Thanks for the suggestions -- I got the variable set up perfectly.

One more question. So now I have my "change" variable. I would like to generate a new variable that counts the number of years since the last regime change. How would I do that?
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index