Statalist


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

RE: st: extract rowname corresponding to row index of matrix


From   Roy Wada <roywada@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: extract rowname corresponding to row index of matrix
Date   Sun, 12 Apr 2009 03:56:43 -0700

 
Looks like the server is sending out much older threads, which is
appearing as new in my box, or the mail had been delayed for ten days,
reaching my box now.
 
Roy
 
> Yes, there is. See -help extended_fcn-
>
> clear
> matrix input BETA=( 193\ 30 \ 133 \ 51\ 9.8 \ 0.1 )
> matrix rownames BETA= dog cat rat mouse flea bubonic
> matrix colnames BETA=IQ
> mat lis BETA
>
> di "row 2 of BETA is `: word 2 of `: rowname BETA''"
>
>
>>
>> But is there an equally simple approach to the reverse problem? I
>> mean: Given a row index, is there an elegant way to extract the name
>> of that row?
>>
>> The solution below seems clumsy. As seen with -matrix LostRowNames-,
>> extracting a one-row matrix from a one-column matrix causes the
>> -rownames- to be lost. Thus my program uses a column join, which seems
>> like a kludge.
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
*
*   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   |   What's new   |   Site index