help diagnostic plots dialogs: symplot quantile qqplot
qnorm pnorm qchi pchi
-------------------------------------------------------------------------------
Title
[R] diagnostic plots -- Distributional diagnostic plots
Syntax
Symmetry plot
symplot varname [if] [in] [, options1]
Ordered values of varname against quantiles of uniform distribution
quantile varname [if] [in] [, options1]
Quantiles of varname1 against quantiles of varname2
qqplot varname1 varname2 [if] [in] [, options1]
Quantiles of varname against quantiles of normal distribution
qnorm varname [if] [in] [, options2]
Standardized normal probability plot
pnorm varname [if] [in] [, options2]
Quantiles of varname against quantiles of chi-squared distribution
qchi varname [if] [in] [, options3]
Chi-squared probability plot
pchi varname [if] [in] [, options3]
options1 description
-------------------------------------------------------------------------
Plot
marker_options change look of markers (color, size, etc.)
marker_label_options add marker labels; change look or position
Reference line
rlopts(cline_options) affect rendition of the reference line
Add plots
addplot(plot) add other plots to the generated graph
Y axis, X axis, Titles, Legend, Overall
twoway_options any options other than by() documented in
[G] twoway_options
-------------------------------------------------------------------------
options2 description
-------------------------------------------------------------------------
Main
grid add grid lines
Plot
marker_options change look of markers (color, size, etc.)
marker_label_options add marker labels; change look or position
Reference line
rlopts(cline_options) affect rendition of the reference line
Add plots
addplot(plot) add other plots to the generated graph
Y axis, X axis, Titles, Legend, Overall
twoway_options any options other than by() documented in
[G] twoway_options
-------------------------------------------------------------------------
options3 description
-------------------------------------------------------------------------
Main
grid add grid lines
df(#) degrees of freedom of chi-squared
distribution; default is df(1)
Plot
marker_options change look of markers (color, size, etc.)
marker_label_options add marker labels; change look or position
Reference line
rlopts(cline_options) affect rendition of the reference line
Add plots
addplot(plot) add other plots to the generated graph
Y axis, X axis, Titles, Legend, Overall
twoway_options any options other than by() documented in
[G] twoway_options
-------------------------------------------------------------------------
Menu
symplot
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Symmetry plot
quantile
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Quantiles plot
qqplot
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Quantile-quantile plot
qnorm
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Normal quantile plot
pnorm
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Normal probability plot, standardized
qchi
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Chi-squared quantile plot
pchi
Statistics > Summaries, tables, and tests > Distributional plots and
tests > Chi-squared probability plot
Description
symplot graphs a symmetry plot of varname.
quantile plots the ordered values of varname against the quantiles of a
uniform distribution.
qqplot plots the quantiles of varname1 against the quantiles of varname2
(Q-Q plot).
qnorm plots the quantiles of varname against the quantiles of the normal
distribution (Q-Q plot).
pnorm graphs a standardized normal probability plot (P-P plot).
qchi plots the quantiles of varname against the quantiles of a
chi-squared distribution (Q-Q plot).
pchi graphs a chi-squared probability plot (P-P plot).
See [R] regress postestimation for regression diagnostic plots and [R]
logistic postestimation for logistic regression diagnostic plots.
Options for symplot, quantile, and qqplot
+------+
----+ Plot +-------------------------------------------------------------
marker_options affect the rendition of markers drawn at the plotted
points, including their shape, size, color, and outline; see [G]
marker_options.
marker_label_options specify if and how the markers are to be labeled;
see [G] marker_label_options.
+----------------+
----+ Reference line +---------------------------------------------------
rlopts(cline_options) affect rendition of the reference line; see [G]
cline_options.
+-----------+
----+ Add plots +--------------------------------------------------------
addplot(plot) provides a way to add other plots to the generated graph;
see [G] addplot_option.
+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------
twoway_options are any of the options documented in [G] twoway_options,
excluding by(). These include options for titling the graph (see [G]
title_options) and for saving the graph to disk (see [G]
saving_option).
Options for qnorm and pnorm
+------+
----+ Main +-------------------------------------------------------------
grid adds grid lines at the 0.05, 0.10, 0.25, 0.50, 0.75, 0.90, and 0.95
quantiles when specified with qnorm. With pnorm, grid is equivalent
to yline(.25, .5, .75) xline(.25, .5, .75).
+------+
----+ Plot +-------------------------------------------------------------
marker_options affect the rendition of markers drawn at the plotted
points, including their shape, size, color, and outline; see [G]
marker_options.
marker_label_options specify if and how the markers are to be labeled;
see [G] marker_label_options.
+----------------+
----+ Reference line +---------------------------------------------------
rlopts(cline_options) affect the rendition of the reference line; see [G]
cline_options.
+-----------+
----+ Add plots +--------------------------------------------------------
addplot(plot) provides a way to add other plots to the generated graph;
see [G] addplot_option.
+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------
twoway_options are any of the options documented in [G] twoway_options,
excluding by(). These include options for titling the graph (see [G]
title_options) and for saving the graph to disk (see [G]
saving_option).
Options for qchi and pchi
+------+
----+ Main +-------------------------------------------------------------
grid adds grid lines at the 0.05, 0.10, 0.25, 0.50, 0.75, 0.90, and 0.95
quantiles when specified with qchi. With pchi, grid is equivalent to
yline(.25, .5, .75) xline(.25, .5, .75).
df(#) specifies the degrees of freedom of chi-squared distribution. The
default is 1.
+------+
----+ Plot +-------------------------------------------------------------
marker_options affect the rendition of markers drawn at the plotted
points, including their shape, size, color, and outline; see [G]
marker_options.
marker_label_options specify if and how the markers are to be labeled;
see [G] marker_label_options.
+----------------+
----+ Reference line +---------------------------------------------------
rlopts(cline_options) affect the rendition of the reference line; see [G]
cline_options.
+-----------+
----+ Add plots +--------------------------------------------------------
addplot(plot) provides a way to add other plots to the generated graph;
see [G] addplot_option.
+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------
twoway_options are any of the options documented in [G] twoway_options,
excluding by(). These include options for titling the graph (see [G]
title_options) and for saving the graph to disk (see [G]
saving_option).
Examples
Setup
. sysuse auto
Symmetry plot of price
. symplot price
Ordered values of price against quantiles of uniform distribution
. quantile price
Quantiles of weightd against quantiles of weightf
. generate weightd=weight if !foreign
. generate weightf=weight if foreign
. qqplot weightd weightf
Quantiles of price against quantiles of normal distribution
. qnorm price
. qnorm price, grid (add a grid background)
Standardized normal probability plot of price
. pnorm price
. pnorm price, grid (add a grid background)
Quantiles of ch against quantiles of chi-squared distribution
. egen c1 = std(price)
. egen c2 = std(mpg)
. generate ch = c1^2 + c2^2
. qchi ch, df(2) grid
Chi-squared probability plot
. pchi ch, df(2) grid
Also see
Manual: [R] diagnostic plots
Help: [R] cumul, [R] kdensity, [R] logistic postestimation, [R] lv,
[R] regress postestimation