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" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: reshaping a large number of variables (correction)
Date   Sat, 20 Sep 2003 18:33:45 +0100

Nick 
n.j.cox@durham.ac.uk 

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