Scatterplot of raw observations in which each point corresponds to an binned average.
RDScatter(
formula,
data,
subset,
cutoff = 0,
na.action,
avg = 10,
xlab = NULL,
ylab = NULL,
vert = TRUE,
propdotsize = FALSE
)
An object of class "ggplot"
, a scatterplot the binned raw
observations.
object of class "formula"
(or one that can be coerced
to that class) of the form outcome ~ running_variable
optional data frame, list or environment (or object coercible by
as.data.frame
to a data frame) containing the outcome and running
variables in the model. If not found in data
, the variables are
taken from environment(formula)
, typically the environment from
which the function is called.
optional vector specifying a subset of observations to be used in the fitting process.
specifies the RD cutoff for the running variable.
function which indicates what should happen when the data
contain NA
s. The default is set by the na.action
setting of
options
(usually na.omit
). Another possible value is
na.fail
Number of observations to average over. If set to Inf
, then
take averages for each possible value of the running variable (convenient
when the running variable is discrete).
x- and y-axis labels
Draw a vertical line at cutoff?
If TRUE
, then size of points is proportional to
number of observations that the point averages over (useful when
avg=Inf
). Otherwise the size of points is constant.
RDScatter(log(earnings)~yearat14, data=cghs, cutoff=1947,
avg=Inf, propdotsize=TRUE)
Run the code above in your browser using DataLab