niqr: Nonlinear Quantile Regression Coefficients Modeling

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/qrcmNL.R

Description

This package implements a nonlinear Frumento and Bottai's (2015) method for quantile regression coefficient modeling (qrcm), in which quantile regression coefficients are described by (flexible) parametric functions of the order of the quantile.

Usage

1
niqr(fun, fun2, x0, X, y, control=list())

Arguments

fun

a function of theta and p describing the beta functions.

fun2

a function of beta and X describing the whole quantile process.

x0

starting values to search minimum.

X

a design matrix containing the intercept.

y

the response variable.

control

a list of control parameters. See 'Details'.

Details

Quantile regression permits modeling conditional quantiles of a response variabile, given a set of covariates.

Assume that each coefficient can be expressed as a parametric function of θ, p of the form:

β(θ, p) = b_0(θ_0, p) + b_1(θ_1, p) + b_2(θ_2 , p) + ….

Users are required to specify a function of θ and p and to provide starting points for the minimization, the design matrix (with intercept) and the response variable. Some control paramters such as, tol=1e-6, α=.1, β=.5, maxit=200, maxitstart=20, cluster=NULL, display=FALSE, ε=1e-12, a1=.001, h1=1e-4, meth="2", lowp=.01, upp=.99, np=100 could be modified from their default. α and β are parameters for line search, tol, epsilon, maxit, and a1 are parameters for quasi Newthod approach, maxit start is the maximum number of iteration for guessing the best start values, h1 and meth (method) are parameters for the gradient (method="2" is centered formula, it is possible to select "1" for right and "3" for five points stencil), lowp, upp and np are parameters used in the integral formula, and cluster if not NULL is a vector of ID to compute standard errors in longitudinal data. fun_prime_theta and fun_prime_beta are the gradient functions of the quantile function with respect to θ and β

Value

An object of class “niqr”, a list containing the following items:

call

the matched call.

x

the optima θ valuse.

se

standard errors for θ.

fx

the value of the minimized integrated loss function.

gx

the gradient calculated in the optimal points.

Hx

the hessian of quasi newthon method

omega

gradient matrix used in the sandwich formaula to compute standard errors.

covar

variance covariance matrix H^(-1)Ω H^(-1).

p.star.y

the CDF calculated in the optimal x values.

code

the convergence code, 0 for convergence, 1 for maxit reached, 2 no more step in the gradient.

internal

a list containing some initial and control object.

Author(s)

Gianluca Sottile gianluca.sottile@unipa.it

References

Frumento, P., and Bottai, M. (2015). Parametric modeling of quantile regression coefficient functions. Biometrics, doi: 10.1111/biom.12410.

See Also

summary.niqr, plot.niqr, predict.niqr, for summary, plotting, and prediction. test.fit.niqr for goodness of fit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n <- 1000
x <- runif(n)
fun <- function(theta, p){
  beta0 <- theta[1] + exp(theta[2]*p)
  beta1 <- theta[3] + theta[4]*p
  cbind(beta0, beta1)}
beta <- fun(c(1,1,1,1), runif(n))
y <- beta[, 1] + beta[, 2]*x
model <- niqr(fun=fun, x0=rep(0, 4), X=cbind(1,x), y=y)

# see the documentation for 'summary.piqr', and 'plot.piqr'

gianluca-sottile/qrcmNL documentation built on May 6, 2019, 6:01 p.m.