regressogram {HoRM} | R Documentation |
Regressogram
Description
Computes and plots the regressogram for a single predictor and single response relationship. The regressogram is plotted using ggplot2
.
Usage
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 |
A vector of response values for the data. Must be the same length as |
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 |
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 |
show.lines |
A logical argument specifying if a line should be drawn connecting the points determined by |
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
Examples
## 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")