Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Mahbubeh Parsaeian <mahbobehparsaeian@yahoo.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: Re st: destring_loop |
Date | Sat, 18 Aug 2012 04:16:08 -0700 (PDT) |
That is very interesting solution. Thanks a lot. ----- Original Message ----- From: Phil Clayton <philclayton@internode.on.net> To: statalist@hsphsun2.harvard.edu Cc: Sent: Saturday, 18 August 2012, 14:20 Subject: Re: Re st: destring_loop That also suggests a one line solution to the current problem, assuming the variables are named var1 var2 and so on: destring var2-var`=c(k)', replace Phil On 18/08/2012, at 6:33 PM, daniel klein wrote: > ... > Even though it is not needed here, Stata stores the number of > variables in the current dataset in c(k). A loop would look like > > forv j = 2/`=c(k)' { > [...] > } > > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/