------------------------------------------------------------------------------- help forcatgraphNick Winter -------------------------------------------------------------------------------

Plotting Means of a Variable, by Category

catgraphyvar xvar[ifexp] [inrange],by(varname)stat(collapse_statistic)graph_options

Description

catgraphplots a summary statistic (means by default) ofyvaragainstxvar, separately for categories ofvarname.

Options

by(varname)specifies the variable that specifies the categories for plotting.catgraphplots one series for each value ofvarname.by()may be numeric or string. Ifbyis not specified, one category encompassing all the data is plotted.

stat()specifies the statistic to be plotted. The default is to plot the mean ofyvarfor each value ofxvar. Any valid statistic for the collapse command may be specified.

Examples

. catgraph mpg rep78, by(foreign) c(ll) ylab(0,35)Graphs mean mileage against repair record, separately for foreign and domestic autos.

. catgraph mpg rep78, by(foreign) c(ll) ylab(0,35) stat(median)Graphs median mileage against repair record, separately for foreign and domestic autos.

AuthorNick Winter Cornell University nw53@cornell.edu