Statalist The Stata Listserver


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

RE: st: Inexplicable errors when using -reshape long-


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Inexplicable errors when using -reshape long-
Date   Sun, 18 Feb 2007 19:34:49 -0000

-renvars- is not official Stata, but may be downloaded
after -search renvars-. 

I guess that the -string- option is an alternative
to what is here, but it's a good idea any way. 

Nick 
[email protected] 

Michael S. Hanson
 
> On Feb 18, 2007, at 5:33 AM, Svend Juul wrote:
> 
> > On Feb 18, 2007, at 4:57 AM, Clive Nicholas wrote:
> >
> >> . reshape long conle98-othle00, i(id) j(year)
> >> no xij variables found
> >> r(111);
> >>
> >> . reshape long rsex01 conle98-othle00, i(id) j(year)
> >> no xij variables found
> >> r(111);
> >
> > You should:
> >    reshape long conle lable ldmle othle , i(id) j(year)
> >
> > Apart from that: I suspect that you will get a problem with the  
> > years 98,99,00;
> > You might want to rename:
> >    rename conle00 conle100
> > to get increasing years.
> 
> 	To reiterate what Svend (and Nick) have suggested:  
> your use of  
> stubs instead of variable names with -reshape- is the source of the r 
> (111) error message.  However, in my experience Svend's 
> conjecture is  
> also correct:  Stata tends not to recognize the crossing of 
> centuries  
> with two-digit years.  You might consider first renaming your data  
> series with -renvars-, such as:
> 
> 	renvars *99, postsub(99 1999)
> 	renvars *00, postsub(00 2000)
> 
> etc., which will save some time over a series of individual -rename-  
> commands.  IMO, the -test- option on -renvars- is 
> particularly useful  
> in cases like this one.  Hope this helps.

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