Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Generate ongoing variable from onset variable


From   "Drury, A. Cooper" <[email protected]>
To   <[email protected]>
Subject   st: Generate ongoing variable from onset variable
Date   Fri, 13 Jan 2006 11:04:04 -0600

Greetings,

I am working with a times-series cross-section data set where the unit
of analysis is the country-pair/year.  The data include a dichotomous
variable indicated when a new policy was initiated.  I also have a
variable that indicates of the duration of that policy (measured in
years).  I need to create a variable that indicates when the policy was
in effect.  For example, one cross-section my look like this:

Policy         Policy     Policy
Initiation     length     ongoing (new variable)
   0             0           0
   1             3           1
   0             0           1
   0             0           1
   0             0           0
   1             2           1
   0             0           1
   0             0           0

I need to create the "policy ongoing" variable.

I have tried generating a new variable, and then typing:
replace newvariable=L.newvariable+(policylength-1)+policyinitiation

This should work, but Stata tells me: (593368 real changes made, 593368
to missing); so all the values are replaced by missing values.

I am really stumped here, any help would be greatly appreciate.

Thanks,
Cooper


 
___________________________
A. Cooper Drury
Assistant Professor
Department of Political Science
University of Missouri
Columbia, MO 65211-6030
573-884-6747
www.missouri.edu/~drurya
 

*
*   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