stepdst.Rd
A step distribution is one where the cdf
and quantile function are step functions.
This includes empirical distributions.
stepdst()
facilitates the creation of
such a distribution by specifying the
observations/breakpoints, along with their weights.
stepdst(y, data, weights = 1, ...) is_stepdst(object) is.stepdst(object)
y | Outcomes to comprise the distribution. Should either evaluate to a vector, or be a name in the specified data. |
---|---|
data | Data frame, list, or environment
containing the outcome name in |
weights | Weights corresponding to the outcomes in |
... | Additional arguments, currently not used. |
object | Object to check |
A "stepdst" object, which is also a "dst" object. The cdf is a right-continuous step function, and the quantile function is a left-continuous step function.
K <- function(x) dnorm(x, sd = 25) cond <- stepdst(hp, data = mtcars, weights = K(disp - 150)) plot(cond, "cdf", n = 1001, lty = 2, add = TRUE)