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

st: RE: RE: reshaping a large number of variables (correction)


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: reshaping a large number of variables (correction)
Date   Sat, 20 Sep 2003 18:33:45 +0100

Nick 
[email protected] 

> 
> foreach v of var *v1 { 
> 	local mylist "`mylist' `=substr("`v'",1,length("`v'")-2)'" 
> } 
> reshape long `mylist', i(id) j(villagenr) string 
> 

You might well need compound double quotes in that: 

foreach v of var *v1 { 
	local mylist `"`mylist' `=substr("`v'",1,length("`v'")-2)'"' 
} 


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