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

st: How to transfer a variable's value into a macro (in a panel dataset)


From   Robin Luo <[email protected]>
To   [email protected]
Subject   st: How to transfer a variable's value into a macro (in a panel dataset)
Date   Fri, 25 Feb 2005 16:28:45 -0800

I know that a command like:

local i = var[`n']

can obtain the nth observation's value into macro i. But my data is a
panel data and I want the nth observation within a certain group into
the macro i, instead of that of the nth observation in general.
Obviously, "local" cannot be used with "by" and I could not figure out
a way to do this. If any one has any idea on this, I would really
appreciate.

Thanks!

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