Statalist The Stata Listserver


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

st: String vector


From   "Hendri Adriaens" <[email protected]>
To   <[email protected]>
Subject   st: String vector
Date   Fri, 27 Apr 2007 19:23:06 +0200

Hi,

I have to do the same tasks for a lot of columns. I want to create a for
loop for that. But then I need to be able to save the column names in a
string vector and do a loop over that. But I can't find a way to make a
string vector. I found it in mata, but then something like:

gen x_`myvector[1]'=5

doesn't do anything. Is there a way to define a string vector in stata and
use it like in the example above? If not, what is the best way to go without
needing to do the for loop by hand?

Thank you, best regards,
-Hendri Adriaens.

-------------------------------- 
Hendri Adriaens 
Researcher CentERdata 
Tilburg Universiteit 
Room K638 
Warandelaan 2 
PO Box 90153 
5000 LE Tilburg, The Netherlands 
Tel.: +31-13-466 3263 / 8325
Fax.: +31-13-466 2764 
E-mail: [email protected]
WWW: http://www.centerdata.nl


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