This function is used to fit a quantile regression model when the response is a count variable.
lqm.counts(formula, data, weights = NULL, offset = NULL, contrasts = NULL,
tau = 0.5, M = 50, zeta = 1e-05, B = 0.999, cn = NULL, alpha = 0.05,
control = list())
an object of class formula
: a symbolic description of the model to be fitted.
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lqm is called.
an optional vector of weights to be used in the fitting process.
an optional offset to be included in the model frame.
an optional list. See the contrasts.arg
of model.matrix.default
.
quantile to be estimated.
number of dithered samples.
small constant (see References).
right boundary for uniform random noise U[0,B] to be added to the response variable (see References).
small constant to be passed to F.lqm
(see References).
significance level.
list of control parameters of the fitting process. See lqmControl
.
an object of class "lqm.counts" containing the following components
the estimated quantile.
regression quantile (on the log--scale).
predicted quantile (on the response scale).
coefficients, standard errors, etc.
the model matrix.
the model response.
offset.
the number of observations.
specified number of dithered samples for standard error estimation.
actual number of dithered samples used for standard error estimation that gave an invertible D matrix (Machado and Santos Silva, 2005).
names for theta.
the terms object used.
the number of residual degrees of freedom.
starting values for theta.
list of control parameters used for optimization (see lqmControl
).
A linear quantile regression model if fitted to the log--transformed response. Additional tranformation functions will be implemented. The notation used here follows closely that of Machado and Santos Silva (2005).
Machado JAF and Santos Silva JMC (2005). Quantiles for counts. Journal of the American Statistical Association, 100(472), 1226--1237.
# NOT RUN {
n <- 100
x <- runif(n)
test <- data.frame(x = x, y = rpois(n, 2*x))
lqm.counts(y ~ x, data = test, M = 50)
# }
Run the code above in your browser using DataLab