Learn R Programming

lqmm (version 1.0)

lqm.counts: Quantile Regression for Counts

Description

This function is used to fit a quantile regression model when the response is a count variable.

Usage

lqm.counts(formula, data, weights = NULL, offset = NULL, contrasts = NULL,
	alpha = 0.5, M = 50, zeta = 1e-05, B = 0.999, cn = NULL)

Arguments

formula
an object of class formula: a symbolic description of the model to be fitted.
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. If not found in data, the variables are taken from environment(formula), typically the environment from which lqm is
weights
an optional vector of weights to be used in the fitting process.
offset
an optional offset to be included in the model frame.
contrasts
an optional list. See the contrasts.arg of model.matrix.default.
alpha
quantile to be estimated.
M
number of dithered samples.
zeta
small constant (see References).
B
right boundary for uniform random noise U[0,B] to be added to the response variable (see References).
cn
small constant to be passed to F.lqm (see Reference).

Value

  • an object of class "list" containing the following components
  • estimate_log_scaleregression quantile on the log--scale
  • std.errstandard error
  • fittedpredicted quantile
  • effectivenumber of dithered samples used for standard error estimation that gave an invertible D matrix (Machado and Santos Silva, 2005).

Details

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

References

Machado JAF and Santos Silva JMC (2005). Quantiles for counts. Journal of the American Statistical Association, 100(472), 1226--1237.

Examples

Run this code
n <- 100
x <- runif(n)
data <- data.frame(x = x, y = rpois(n, 2*x))
lqm.counts(y ~ x, data = data, M = 20)

Run the code above in your browser using DataLab