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   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: values of string variable into matrix rownames
Date   Fri, 2 Mar 2007 18:58:13 -0500

Tom Boonen--
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

On 3/2/07, Tom Boonen <[email protected]> wrote:
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index