Stefan:
The following example shows one way to do that.
*------- begin example -----------
sysuse auto, clear
tabstat price, by(foreign) st(median) save
scalar `r(name1)' = el(r(Stat1),1,1)
scalar `r(name2)' = el(r(Stat2),1,1)
di scalar(Foreign)
di scalar(Domestic)
*---------- end example ---------
HTH,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
--- Gawrich Stefan wrote:
I want to obtain aggregate values (e.g. median age by sex) from an
individual data set and generate locals out of them (to show the values in a
textbox in a graph).
*
* 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/