Compute conditional mid-cumulative probabilities
cmidecdf(formula, data, ecdf_est = "npc", npc_args = list(),
theta = NULL, subset, weights, na.action,
contrasts = NULL)
cmidecdf.fit(x, y, intercept, ecdf_est, npc_args = list(),
theta = NULL)
An object of class class
cmidecdf
with mid-cumulative probabilities. This is a list that contains:
Estimated conditional mid-probabilities. This is a \(n * k\) matrix, where \(n\) is the sample size and \(k\) is the number of unique values of y
.
Estimated (standard) cumulative probabilities.
Standard error for Fhat.
unique values of y
.
npcdistbw
object.
estimator used.
an object of class "formula
" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under `Details'.
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. By default the variables are taken from the environment from which the call is made.
estimator of the (standard) conditional cumulative distribution. The options are: npc
(default) for kernel estimator (Li and Racine, 2008); logit
, probit
, cloglog
for binomial regression; ao
for Aranda-Ordaz binomial regression.
named list of arguments for npcdistbw
when ecdf_est = npc
.
values of the Aranda-Ordaz transformation parameter for grid search when ecdf_est = "ao"
.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of weights to be used in the fitting process. Not currently implemented.
a function which indicates what should happen when the data contain NA
s.
an optional list. See the contrasts.arg of model.matrix.default
.
design matrix of dimension \(n * p\).
vector of observations of length \(n\).
logical flag. Does x
include a vector of ones?
Marco Geraci with contributions from Alessio Farcomeni
Geraci, M. and A. Farcomeni. Mid-quantile regression for discrete responses. arXiv:1907.01945 [stat.ME]. URL: https://arxiv.org/abs/1907.01945.
Li, Q. and J. S. Racine (2008). Nonparametric estimation of conditional cdf and quantile functions with mixed categorical and continuous data. Journal of Business and Economic Statistics 26(4), 423-434.
Peracchi, F. (2002). On estimating conditional quantiles and distribution functions. Computational Statistics and Data Analysis 38(4), 433-447.
midecdf
if (FALSE) {
n <- 100
x <- rnorm(n, 0, 3)
y <- floor(1 + 2*x) + sample(1:5, n, replace = TRUE)
cmidecdf(y ~ x, ecdf_est = "logit")
}
Run the code above in your browser using DataLab