Learn R Programming

cdfquantreg (version 1.3.1-2)

cdfquantregH: Zero/One inflated CDF-Quantile Probability Distributions

Description

cdfquantregH is the a function to fit a Zero/One inflated CDF-Quantile regression with a variety of distributions .

Usage

cdfquantregH(
  formula,
  zero.fo = ~1,
  one.fo = ~1,
  fd = NULL,
  sd = NULL,
  data,
  family = NULL,
  type = "ZI",
  start = NULL,
  control = cdfqr.control(...),
  ...
)

Value

An object of class cdfqrH will be returned. Generic functions such as summary,print (e.g., print.cdfqr) and coef can be used to extract output (see summary.cdfqr for more details about the generic functions that can be used). Class of object is a list with the following output:

coefficients

A named vector of coefficients.

residuals

Raw residuals, the difference between the fitted values and the data.

fitted

The fitted values, including full model fitted values, fitted values for the mean component, and fitted values for the dispersion component.

vcov

The variance-covariance matrix of the coefficient estimates.

AIC, BIC

Akaike's Information Criterion and Bayesian Information Criterion.

Arguments

formula

A formula object, with the dependent variable (DV) on the left of an ~ operator, and predictors on the right. For the part on the right of '~', the specification of the location and dispersion submodels can be separated by '|'. So y ~ X1 | X2 specifies that the DV is y, X1 is the predictor in the location submodel, and X2 is the predictor in the dispersion submodel.

zero.fo

A formula object to indicate the predictors for the zero component, only input as ~ predictors

one.fo

A formula object to indicate the predictors for the one component, only input as ~ predictors

fd

A string that specifies the parent distribution.

sd

A string that specifies the child distribution.

data

The data in a data.frame format

family

If `fd` and `sd` are not provided, the name of a member of the family of distributions can be provided (See cdfqrFamily for details of family functions)

type

A string variable to indicate whether the model is zero-inflated `ZI`, or one-inflated `OI`, or zero-one inflated `ZO`.

start

The starting values for model fitting. If not provided, default values will be used.

control

Control optimization parameters (See cdfqr.control))

...

Currently ignored.

Details

The cdfquantreg function fits a quantile regression model with a distributions from the cdf-quantile family selected by the user (Smithson and Shou, 2015). The model is specified in a two-part formula, one part containing the predictors of the location parameter, and the second part containing the predictors of the dispersion parameter. The models are fitted in two stages, the first of which uses the Nelder-Mead algorithm and the second of which takes the estimates from the first stage and applies the BFGS algorithm to refine the estimates.

Examples

Run this code
data(cdfqrExampleData)
# For one-inflated model
ipcc_high <- subset(IPCC, mid == 1 & high == 1 & prob!=0)
fit <- cdfquantregH(prob ~ valence | valence,one.fo = ~valence,
  fd ='t2',sd ='t2', type = "OI", data = ipcc_high)

summary(fit)

# For zero-inflated model
ipcc_low <- subset(IPCC, mid == 0 & high == 0 & prob!=1)
fit <- cdfquantregH(prob ~ valence | valence, zero.fo = ~valence,
  fd ='t2',sd ='t2', type = "ZI", data = ipcc_low)
 
 
# For zero &one-inflated model
ipcc_mid <- subset(IPCC, mid == 1 & high == 0)
fit <- cdfquantregH(prob ~ valence | valence, zero.fo = ~valence,
  one.fo = ~valence,
  fd ='t2',sd ='t2', type = "ZO", data = ipcc_mid)
 
  

Run the code above in your browser using DataLab