RSS syndicated content from Statalist, a discussion listserv generated by users of StataCorp Stata statistical analysis software. Subscribe to the RSS feed using the links provided in the sidebar. You must join the listserv in order to respond to, or add, new posts. For more information on Statalist, click on the 'Statalist FAQ' link in the sidebar.

The "Mata Matters" column in the next Stata Journal deals with exactly
this problem. The title of the column is "Creating new variables"
with the subtitle, "Sounds boring, isn't", although I don't know if the
editors let me keep that last part.

Anyway, I suggest Uli read that, because I hada lot to say, all of it relevant.

In the meantime, let me provide a crude solution to Uli's problem.

First thing, Uli, is to create the variables in the Stata dataset
to hold the columns of out. In what follows, I will assume those
variables are named x1, x2, and x3.

Second thing, I assume that the Stata dataset has the number of observations
as out has rows.