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" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
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 <tom.boonen.maiden@gmail.com> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index