binmeans | R Documentation |
Plot average values of the outcome for bins of the forcing variable, a common plot in regression discontinuity analysis
binmeans(x, y, width = NULL, center = NULL, g = NULL, ...)
## Default S3 method:
binmeans(x, y, width = NULL, center = NULL, g = NULL, ..., name_g = "colour")
## S3 method for class 'formula'
binmeans(x, y, width = NULL, center = NULL, ...)
StatBinmeans
geom_binmeans(
mapping = NULL,
data = NULL,
stat = "binmeans",
position = "identity",
...,
center = NULL,
width = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
x , y |
either two numeric vector for the default method, or a formula and a data frame for the formula method |
width |
the width of the bins |
center |
the cuting value of the forcing variable |
g |
a grouping variable |
... |
further arguments |
name_g |
internally used by the geom |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
An object of class StatBinmeans
(inherits from Stat
, ggproto
, gg
) of length 4.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.