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

Re: st: saving a matrix with rownames

From   "Data Analytics Corp." <>
Subject   Re: st: saving a matrix with rownames
Date   Mon, 02 Jun 2008 07:34:16 -0400

Good morning,

I eventually downloaded svmt2 and it worked like a charm. Sergiy's method is a great way to learn, as you said, the basics - which I need to start learning for Stata.



Nick Cox wrote:

Sergiy's code is a good reminder that you can do it yourself from
This is essentially what -svmat2- (-search- for locations) does over
Sergiy Radyakin

Perhaps this is what you were originally planning to do?

matrix A=1

local names : rownames A
gen names=""
forvalues i=1/`: word count `names'' {
replace names=`"`: word `i' of `names''"' in `i'

On 5/30/08, Data Analytics Corp. <> wrote:

I created a matrix, M, with row names such as Frag300, Frag400, etc.
I want

to save the matrix as a set of variables so I used svmat, which worked
perfectly. But I also want to save the row names as a variable, say

I used the following:

local names : rownames M
gen str rown = "`names'"

and got the variable rown, but it's blank. I also used

gen str rown = `names'

but got an error message saying Frag300 not found. How do I save the

names as a variable?

I'm using Stata 10 on a Vista machine.
* For searches and help try:


Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
(V) 609-936-8999
(F) 609-936-3733

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index