Statalist The Stata Listserver


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

RE: st: values of string variable into matrix rownames


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: values of string variable into matrix rownames
Date   Sun, 4 Mar 2007 16:27:22 -0000

In other words, what can go in rownames is very restricted! 

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

Austin Nichols
 
> read -help levelsof- and -help matrix rownames- first, but you may
> need something from -help extended_fcn- to process the list of
> values...
> 
> sysuse auto, clear
> levelsof make, local(m)
> mat j=J(74,1,0)
> local nodot: subinstr loc m "." "", all
> mat rownames j = `nodot'
> mat li j
> local nospace: subinstr loc nodot " " "", all
> local respace: subinstr loc nospace "'`" "' `", all
> mat rownames j = `respace'
> mat li j
 
Tom Boonen 

> > how can I extract values of a string varaible and put them into
> > rownames of a matrix?

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