cmidecdf: Mid-distribution Functions

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/Qtools.R

Description

Compute conditional mid-cumulative probabilities

Usage

1
2
3
cmidecdf(formula, data, ecdf_est = "npc", bws = NULL, theta = NULL,
	subset, weights, na.action, contrasts = NULL)
cmidecdf.fit(x, y, intercept, ecdf_est, bws = NULL, theta = NULL)

Arguments

formula

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’.

data

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.

ecdf_est

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.

bws

optional bandwidth specification. See npcdist for more details.

theta

values of the Aranda-Ordaz transformation parameter for grid search when ecdf_est = "ao".

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of weights to be used in the fitting process. Not currently implemented.

na.action

a function which indicates what should happen when the data contain NAs.

contrasts

an optional list. See the contrasts.arg of model.matrix.default.

x

design matrix of dimension n * p.

y

vector of observations of length n.

intercept

logical flag. Does x include a vector of ones?

Value

An object of class class cmidecdf with mid-cumulative probabilities. This is a list that contains:

G

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.

Fhat

Estimated (standard) cumulative probabilities.

Fse

Standard error for Fhat.

yo

unique values of y.

bw

npcdistbw object.

ecdf_est

estimator used.

Author(s)

Marco Geraci with contributions from Alessio Farcomeni

References

Geraci, M. and A. Farcomeni. Mid-quantile regression for discrete responses. arXiv:1907.01945 [stat.ME]. URL: http://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.

See Also

midecdf

Examples

1
2
3
4
5
6
7
## Not run: 
n <- 100
x <- rnorm(n, 0, 3)
y <- floor(1 + 2*x) + sample(1:5, n, replace = TRUE)
cmidecdf(y ~ x, ecdf_est = "logit")

## End(Not run)

marco-geraci/Qtools documentation built on Oct. 10, 2019, 9:05 p.m.