Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Filling a matrix


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Filling a matrix
Date   Tue, 15 Apr 2003 09:31:41 +0100

Graeme Inglis

> I have a 1500x1 matrix and want to create a 1500 x 50 
> matrix where the 50
> columns are identical and a repeat of col 1.
> Later I want to create another matrix of duplicated rows.
> I can't find the Stata command to do these manipulations. 

Assuming that A is an appropriate vector, 
and that -matsize- is not limiting, you 
can copy columns by 

forval i = 1/50 { 
	mat B = nullmat(B) , A 
}

and rows by using \ instead of ,. 

Nick 
[email protected] 

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