Stata 15 help for spikeplot

[R] spikeplot -- Spike plots and rootograms

Syntax

spikeplot varname [if] [in] [weight] [, options]

options Description ------------------------------------------------------------------------- Main round(#) round varname to nearest multiple of # (bin width) fraction make vertical scale the proportion of total values; default is frequencies root make vertical scale show square roots of frequencies

Plot spike_options affect rendition of plotted spikes

Add plots addplot(plot) add other plots to generated graph

Y axis, X axis, Titles, Legend, Overall, By twoway_options any options documented in [G-3] twoway_options ------------------------------------------------------------------------- fweights, aweights, and iweights are allowed; see weight.

Menu

Graphics > Distributional graphs > Spike plot and rootogram

Description

spikeplot produces a frequency plot for a variable in which the frequencies are depicted as vertical lines from zero. The frequency may be a count, a fraction, or the square root of the count (Tukey's rootogram, circa 1965). The vertical lines may also originate from a baseline other than zero at the user's option.

Options

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

round(#) rounds the values of varname to the nearest multiple of #. This action effectively specifies the bin width.

fraction specifies that the vertical scale be the proportion of total values (percentage) rather than the count.

root specifies that the vertical scale show square roots. This option may not be specified if fraction is specified.

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

spike_options affect the rendition of the plotted spikes; see [G-2] graph twoway spike.

+-----------+ ----+ Add plots +--------------------------------------------------------

addplot(plot) provides a way to add other plots to the generated graph; see [G-3] addplot_option.

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

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

Examples

--------------------------------------------------------------------------- Setup . webuse ghanaage

Spike plot . spikeplot age [fw=pop], ytitle("Population in 1000s") xlab(0(10)90) xmtick(5(10)85)

--------------------------------------------------------------------------- Setup . webuse splotxmpl

Rootogram . spikeplot normal, round(.10) xlab(-4(1)4) root ---------------------------------------------------------------------------


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