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

st: scrolling over observations


From   "Dr. J. Clovis, Economics" <Joel.Clovis@bristol.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: scrolling over observations
Date   Tue, 01 Feb 2005 10:46:51 +0000

Dear listers,
I am grateful to Michael Blasnik, Scott Merryman, Russell Diamond and Nick Cox for their helpful advice and code.

Russell's code worked best, either as it was, or with Nick's modifications. Michael's made Stata complain "not possible with numeric variable" and would not work even after I used decode. Scott's code produced the same effect as my original code, namely '1' at the start of each block of observations of a company, and '0' for the rest of the block.

Thanks to Nick Cox for the additional advice concerning why the incrementing of `count'+1 in my code would not work.

I now have code which allows me to identify a large number of companies by a numeric tag and to be able to count the total number in one easy line.

Once again my thanks to all who contributed.


Joel Clovis


----------------------
Dr. J.S. Clovis,

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index