Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: single elements of varlist
From
"[email protected]" <[email protected]>
To
[email protected]
Subject
st: single elements of varlist
Date
Mon, 28 Mar 2011 09:53:25 +0200 (CEST)
Dear Statalist,
I am new to programming and I have a basic problem. I need to refer to the
single variables in "varlist" and I am not sure how. For example, I might to
get the sum of: the mean of the first variable, the median of the second
variable and the standard deviation of the third variable.
Thanks a lot for any feedback,
Andrea
program define myprog, rclass
syntax varlist
get the mean of variable 1
get the median of variable 2
get the standard deviation of variable 3
return scalar results=(sum of the previous three values)
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/