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

st: Re: scrolling over observations


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: scrolling over observations
Date   Tue, 1 Feb 2005 07:30:00 -0500

The error from encode indicates that your company name variable was actually numeric to start with (I assume it was just some numeric code of some type but not already encoded?). In that case, encode certainly wouldn't work and the other solutions make sense.

Michael Blasnik
michael.blasnik@verizon.net


----- Original Message ----- From: "Dr. J. Clovis, Economics" <Joel.Clovis@bristol.ac.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, February 01, 2005 5:46 AM
Subject: st: scrolling over observations



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