qhgld.reg: Predict quantiles of a Hurdle Generalized Lambda regression

Description Usage Arguments Details Value References Examples

View source: R/qhgld.reg.R

Description

Quantile function of a Hurdle Generalized Lambda Regression.

Usage

1
qhgld.reg(p, reg, newvalues, l0 = TRUE, location = TRUE)

Arguments

p

Vector of probabilities.

reg

An object of class reg.hgld.

newvalues

A data frame with the new values of the covariates. Column names must match the ones given in formulas loc.formula and zero.formula of the reg.hgld object.

l0

Whether to return the lambda0 of each profile.

location

Whether to return the location of each profile.

Details

Given an object of class reg.hgld, a percentile and new values for the covariates, it returns the quantile of the fitted HGLD, given the covariates. The fitted HGLD must be non-negative. The contrast on the newvalues data frame must be the same of the data used to fit the reg.hgld regression.

Value

The quantile of the new values, according to the fitted HGLD regression.

References

Marcondes, D.; Peixoto, C.; Maia, A. C.; A Survey of a Hurdle Model for Heavy-Tailed Data Based on the Generalized Lambda Distribution. (2017) arxiv1712.02183

Examples

1
2
3
4
5
6
7
8
set.seed(100)
tmp <- na.omit(healthcare)
data <- tmp[sample(1:nrow(tmp),50),]
formula <- log_expense ~ age + sex + log_previous_expense
reg <- suppressWarnings(reg.hgld(data = data,zero.formula = formula,loc.formula = formula,
                        full = FALSE,param = "rs"))
newvalues <- tmp[sample(1:nrow(tmp),5),c(2,3,8)]
qhgld.reg(p = seq(0.05,0.95,0.1),reg,newvalues)

dmarcondes/HGLD documentation built on May 28, 2019, 12:56 p.m.