Stata 15 help for grmeanby

[R] grmeanby -- Graph means and medians by categorical variables

Syntax

grmeanby varlist [if] [in] [weight] , summarize(varname) [options]

options Description ------------------------------------------------------------------------- Main * summarize(varname) graph mean (or median) of varname median graph medians; default is to graph means

Plot cline_options change look of the lines marker_options change look of markers (color, size, etc.) marker_label_options add marker labels; change look or position

Y axis, X axis, Titles, Legend, Overall twoway_options any options other than by() documented in [G-3] twoway_options ------------------------------------------------------------------------- *summarize(varname) is required. aweights and fweights are allowed; see weight.

Menu

Statistics > Summaries, tables, and tests > Summary and descriptive statistics > Graph means/medians by groups

Description

grmeanby graphs the (optionally weighted) means or medians of varname according to the values of the variables in varlist. The variables in varlist may be string or numeric and, if numeric, may be labeled.

Options

+------+ ----+ Main +-------------------------------------------------------------

summarize(varname) is required; it specifies the name of the variable whose mean or median is to be graphed.

median specifies that the graph is to be of medians, not means.

+------+ ----+ Plot +-------------------------------------------------------------

cline_options affect the rendition of the lines through the markers, including their color, pattern, and width; see [G-3] cline_options.

marker_options affect the rendition of markers drawn at the plotted points, including their shape, size, color, and outline; see [G-3] marker_options.

marker_label_options specify if and how the markers are to be labeled; see [G-3] marker_label_options.

+-----------------------------------------+ ----+ Y axis, X axis, Titles, Legend, Overall +--------------------------

twoway_options are any of the options documented in [G-3] twoway_options, excluding by(). These include options for titling the graph (see [G-3] title_options) and for saving the graph to disk (see [G-3] saving_option).

Examples

Setup . sysuse auto

Graph means of mpg according to values of foreign, rep78, and turn . grmeanby foreign rep78 turn, sum(mpg)

Same as above, but graph medians rather than means . grmeanby foreign rep78 turn, sum(mpg) median


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index