Wallace, John
>
> Sorry for the cryptic original message. The problem arises
> when you have
> more than one variable you're using ci on:
>
> . sysuse auto
> . statsby "ci price mpg" mean = r(mean) upper = r(ub) lower = r(lb)
> foldrange = (r(ub)/r(lb)), by(for)
>
> The output will only show the data for mpg, the price data
> gets overwritten
> before statsby acts on it.
>
> Is there some sort of dataset structure I could use to loop
> through a series
> of variables summarizing them with -ci- and tabulating the
> r() values?
Here's one way. Another way would be to
do -statsby- separately for each variable
and -merge- the results. Another way
would be to -stack- your responses into
one variable and then apply -statsby-.
There are, no doubt, yet other ways.
One possible other way might be to use -parmby- (part of tthe -parmest-
package) instead of -statsby-, and to use the -regress- command to generate
the means for each variable, and then to use -dsconcat- to concatenate the
output data sets for each variable. For instance, John might write a program