Statalist The Stata Listserver


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

st: replicating rows of a matrix


From   "Lucy Morecroft" <[email protected]>
To   <[email protected]>
Subject   st: replicating rows of a matrix
Date   Mon, 20 Feb 2006 13:40:03 +0000

Hi Statalist,

I have a 1 x 5 matrix (A) and I am trying to create another matrix B,
which is basically the rows of A replicated k times (so dimensions for B
are k x 5). I am trying to use the nullmat function, which i found
quoted in a message in your archive "st: RE: Filling a matrix", my code
follows:

local k rowsof(C)

matrix A = (1600,6400,7000,7000,7000)

forval i = 1/`k' { 
	mat B = nullmat(B) \ A 
}

Using the above i get an invalid syntax error. Does anyone see what
mistake I am making? Can I use local values with nullmat?

Thanks in advance

Lucy Morecroft
Information Officer
Trent Cancer Registry





                                        

*
*   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