regressogram: Regressogram

Description Usage Arguments Value References See Also Examples

View source: R/regressogram.R

Description

Computes and plots the regressogram for a single predictor and single response relationship. The regressogram is plotted using ggplot2.

Usage

1
2
3
regressogram(x, y, nbins = 10, show.bins = TRUE,
			       show.means = TRUE, show.lines = TRUE,
             x.lab = "X", y.lab = "Y", main = "TITLE")

Arguments

x

A vector of predictor values for the data. Must be the same length as y.

y

A vector of response values for the data. Must be the same length as x.

nbins

How many bins to use construction of the regressogram.

show.bins

A logical argument specifying if dashed vertical lines should be drawn at the boundaries of the bins. Default is TRUE.

show.means

A logical argument specifying if a large point should be overlayed at the midpoint of each bin and the respective mean of the response values within that bin. Default is TRUE.

show.lines

A logical argument specifying if a line should be drawn connecting the points determined by show.means. Default is TRUE.

x.lab

Label for the x-axis.

y.lab

Label for the y-axis.

main

Title for the regressogram.

Value

regressogram returns a plotted regressogram using the ggplot2 package.

References

Wasserman, L. (2006), All of Nonparametric Statistics, Springer.

Young, D. S. (2017), Handbook of Regression Methods, CRC Press.

See Also

hist

Examples

1
2
3
4
5
6
7
 
## Regressogram for the natural gas dataset.

data(gas)

regressogram(x = gas$LA, y = gas$OK, nbins = 6, x.lab = "LA",
             y.lab = "OK", main = "Regressogram")

HoRM documentation built on March 11, 2021, 9:07 a.m.