qrmix {qrmix}R Documentation

Quantile Regression Classification

Description

qrmix estimates the components of a finite mixture model by using quantile regression to select a group of quantiles that satisfy an optimality criteria chosen by the user.

Usage

qrmix(formula, data, k, Ntau=50, alpha=0.03, lossFn="Squared", fitMethod="lm",
xy=TRUE, ...)

Arguments

formula

an object of class "formula".

data

an optional data frame that contains the variables in formula.

k

number of clusters.

Ntau

an optional value that indicates the number of quantiles that will be considered for quantile regression comparison. Ntau should be greater or equal than 2k.

alpha

an optional value that will determine the minimum separation between the k quantiles that represent each of the k clusters. alpha should be smaller than \frac{1}{2k}.

lossFn

the loss function to be used to select the best combination of k quantiles. The available functions are "Squared", "Absolute", "Bisquare", and "Huber".

fitMethod

the method to be used for the final fitting. Use "lm" for OLS (default), "rlm" for robust regression, and "rq" to use fit from quantile regression.

xy

logical. If TRUE (the default), the data will be saved in the qrmix object.

...

additional arguments to be passed to the function determined in fitMethod.

Details

The optimality criteria is determined by the lossFn parameter. If, for example, the default value is used (lossFn = "Squared"), the k quantiles selected will minimize the sum of squared residuals. Use "Bisquare" or "Huber" to make the method less sensitive to outliers.

Value

qrmix returns an object of class "qrmix"

coefficients

a matrix with k columns that represent the coefficients for each cluster.

clusters

cluster assignment for each observation.

quantiles

the set of k quantiles that minimize the mean loss.

residuals

the residuals, response minus fitted values.

fitted.values

the fitted values.

call

the matched call.

xy

the data used if xy is set to TRUE.

References

Emir, B., Willke, R. J., Yu, C. R., Zou, K. H., Resa, M. A., and Cabrera, J. (2017), "A Comparison and Integration of Quantile Regression and Finite Mixture Modeling" (submitted).

Examples

data(blood.pressure)

#qrmix model using default function values:
mod1 = qrmix(bmi ~ ., data = blood.pressure, k = 3)
summary(mod1)

#qrmix model using Bisquare loss function and refitted with robust regression:
mod2 = qrmix(bmi ~ age + systolic + diastolic + gender, data = blood.pressure, k = 3,
Ntau = 25, alpha = 0.1, lossFn = "Bisquare", fitMethod = "rlm")
summary(mod2)




[Package qrmix version 0.9.0 Index]