Hello,
I have a dataset with a string variable called V1 that is a description of the observation. For select observations, one at a time, I'd like to put the value of V1 for that observation into a local. Something like:
I know this seems like a tremendously silly thing to do, but I swear for my application it is ideal.
If V1 were numeric, I could easily do this as:
V1 is a string. Is there anyway to programmatically reference the output of --list-- or --tab-- to put its output into a local like this?
Thank you,
Mitch
I have a dataset with a string variable called V1 that is a description of the observation. For select observations, one at a time, I'd like to put the value of V1 for that observation into a local. Something like:
Code:
foreach n of 1/5 { list V1 if _n == `n' local temp = r(output) }
If V1 were numeric, I could easily do this as:
Code:
foreach n of 1/5 { sum V1 if _n == `n' local temp = r(mean) }
Thank you,
Mitch
Comment