Dear Statalist,

I want to obtain some descriptives of a continuous variable by age group. I can achieve the numbers I want by using:

Code:
sort agegroup
by agegroup: ci means FEV1
This gives me an output like this:

Code:
-----------------------------------------------------------------------------------------------
-> agegroup = 20.0-24.9

    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
        FEV1 |        222    3,886306     ,054983        3,777948    3,994664

-----------------------------------------------------------------------------------------------
-> agegroup = 25.0-29.9

    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
        FEV1 |        301    3,965914    ,0489052        3,869673    4,062154

-----------------------------------------------------------------------------------------------
-> agegroup = 30.0-34.9

    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
        FEV1 |        342    3,838918    ,0444053        3,751575    3,926261
But it would be more convenient to get an output like this, as I'm exporting it to an Excel table:

Code:
agegroup  | mean(FEV1)       [95% Conf. Interval]
----------+----------------------------------------
20.0-24.9 |   3,886306        3,777948    3,994664
25.0-29.9 |   3,965914        3,869673    4,062154
30.0-34.9 |   3,838918        3,751575    3,926261
etc.
Any suggestions?