Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: create a dataset or vector of variable names


From   "Sheena Sullivan" <sheena.sullivan@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: AW: create a dataset or vector of variable names
Date   Thu, 25 Feb 2010 09:40:32 -0800

Thanks very much for that.  To sum, I did the following 


use mydata, clear
ssc inst descsave
descsave, sa(varname)  keep(name)
use varname
li

forval i = 1/109 { 			
	local names `names' `=name[`i']' 
}
matrix colnames R = `names' 
clear
svmat mymat, names( col )


which gave me a dataset from my matrix with the appropriate variables names.
Thanks again,
Sheena 

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index