**[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
__rlop__**ts(***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-3]** *twoway_options*
-------------------------------------------------------------------------

*options2* Description
-------------------------------------------------------------------------
Main
__g__**rid** 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
__rlop__**ts(***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-3]** *twoway_options*
-------------------------------------------------------------------------

*options3* Description
-------------------------------------------------------------------------
Main
__g__**rid** 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
__rlop__**ts(***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-3]** *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 diagnostic plots** 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-3]**
*marker_options*.

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

+----------------+
----+ Reference line +---------------------------------------------------

**rlopts(***cline_options***)** affect the rendition of the reference line; see
**[G-3]** *cline_options*.

+-----------+
----+ 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 +--------------------------

*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*).

__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-3]**
*marker_options*.

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

+----------------+
----+ Reference line +---------------------------------------------------

**rlopts(***cline_options***)** affect the rendition of the reference line; see
**[G-3]** *cline_options*.

+-----------+
----+ 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 +--------------------------

*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*).

__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 the chi-squared distribution.
The default is **df(1)**.

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

*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*.

+----------------+
----+ Reference line +---------------------------------------------------

**rlopts(***cline_options***)** affect the rendition of the reference line; see
**[G-3]** *cline_options*.

+-----------+
----+ 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 +--------------------------

*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**

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**