Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: replicate matrix elements
From
daniel klein <[email protected]>
To
[email protected]
Subject
Re: st: replicate matrix elements
Date
Fri, 27 Jan 2012 00:32:45 +0100
Here is another possibility
mata : st_matrix("A", vec(J(1, 4, (1, 4)')')')
Best
Daniel
--
Is there a command in Stata to construct a vector
A= (1,1,1,4,4,4)
out of an original vector (1,4) by replicating its elements?
In R this would be done with
rep(c(1,4), each=3, times=1)
*
* 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/