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

st: assignment by indexing

From   "Ben Pelzer" <[email protected]>
To   <[email protected]>
Subject   st: assignment by indexing
Date   Tue, 3 Feb 2004 13:37:42 +0100

Dear stata-users,

Since I'm a stata-rooky this question probably is very basic. I'm looking
for a way to copy the contents of a specific variable out of the list "x1 x2
x3 x4 x5" to a new variable, newvar, say. However, which variable to copy
depends on the value of another variable, index, say. So I would need
something like:

generate newvar = x(index).

How can I realize this in Stata? I looked through the P programming and the
U user manual, but got stuck. Ben Pelzer.

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index