Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: replicate matrix elements

From   Robert Duval <>
Subject   st: replicate matrix elements
Date   Thu, 26 Jan 2012 16:45:55 -0600


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)

Any suggestions will be appreciated
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index