Questions tagged [quantreg]

quantreg is an R package that provides tools for estimation and inference of models of conditional quantiles.

This package includes methods for

  • linear and nonlinear parametric and non-parametric (total variation penalized) models for conditional quantiles of a univariate response
  • handling censored survival data
  • Portfolio selection based on expected shortfall risk

The package was created by and is maintained by Roger Koenker.

100 questions
9
votes
1 answer

Error in summary quantreg backsolve

When I run a quantile regression in R, using the quantreg package, and then I run summary(quantregObject), I get this error message: Error in base::backsolve(r, x, k = k, upper.tri = upper.tri, transpose = transpose, : singular matrix in…
Alberto
  • 91
  • 1
  • 2
8
votes
2 answers

Calculating 95% confidence intervals in quantile regression in R using rq function

I would like to get 95% confidence intervals for the regression coefficients of a quantile regression. You can calculate quantile regressions using the rq function of the quantreg package in R (compared to an OLS…
ehi
  • 409
  • 8
  • 23
8
votes
2 answers

Extract R^2 from quantile regression / summary()

I am using the quantreg package to run the following quantile regression in R: bank <-rq(gekX~laggekVIXclose+laggekliquidityspread+lagdiffthreeMTBILL+ lagdiffslopeyieldcurve+lagdiffcreditspread+laggekSPret, tau=0.99) and extract the coefficients…
schloni
  • 123
  • 2
  • 5
7
votes
2 answers

quantile regression+ dummy variable

I used the quantreg package in R to compute the quantile regression model. In the model, dependent Variable(Y) is NAS_DELAY, and the independent variable(Xs) are SEANSON1TO4, SEANSON2TO4, SEANSON3TO4. The model is: …
shitong
  • 71
  • 1
  • 3
5
votes
1 answer

Confidence interval bands in ggplot2 when using stat_quantile?

I would like to add the median spline and corresponding confidence interval bands to a ggplot2 scatter plot. I am using the 'quantreg'-package, more specifically the rqss function (Additive Quantile Regression Smoothing). In ggplot2 I am able to add…
bonna
  • 1,575
  • 2
  • 17
  • 31
5
votes
1 answer

What are quantiles in ggplot stat_quantile?

Here is my reproducible data: library("ggplot2") library("ggplot2movies") library("quantreg") set.seed(2154) msamp <- movies[sample(nrow(movies), 1000), ] I am trying to become acquainted with stat_quantile but the example from the…
vanao veneri
  • 970
  • 2
  • 12
  • 31
5
votes
4 answers

how to extract upper/lower bounds on coefficients from quantile regression rq()

I'd like to extract coefficients and upper and lower bounds from a quantile regression using the quantreg package. Here's an example from the help file. data(engel) attach(engel) taus <- c(.05,.1,.25,.75,.9,.95) f <-…
Eric Green
  • 7,385
  • 11
  • 56
  • 102
5
votes
2 answers

Quantile regression and p-values - getting more decimal places

Using R, and package quantreg, I am performing quantile regression analyses to my data. I can get access to the p-values using the se (standard error) estimator in the summary function, as below, however I only get 5 decimal places, and would like…
Luke
  • 643
  • 1
  • 10
  • 17
4
votes
1 answer

R Package quantreg: Extract p-values

I have a data series of around 250 annual maximum rainfall measurements, maxima[,] and want to apply quantile regression to all series at once and obtain the significance of each regression model in R. library(quantreg) qmag <- array(NA,…
Mari
  • 43
  • 1
  • 4
4
votes
4 answers

Quantile Regression in Python gives different results than in R

QuantReg from statsmodels package in Python gives very different results than in R, using the data as shown in the following code. I tried the STACKLOSS data in Python and R respectively, and the results were the same. I wonder if the data itself…
aspire
  • 155
  • 1
  • 1
  • 9
4
votes
1 answer

How to get confidence intervals by bootstrapping for quantile regressions by default

In my statistics class we use Stata and since I'm an R user I want to do the same things in R. I've gotten the right results but it seems like a somewhat awkward way of getting something as simple as confidence intervals. Here's my crude…
Max Gordon
  • 5,367
  • 2
  • 44
  • 70
3
votes
2 answers

Calculating piecewise quantile linear regression with segmented package R

I am looking for a way to obtain the piecewise quantile linear regression with R. I have been able to compute the Quantile regression with the package quantreg. However, I don't want just 1 unique slope but want to check for breakpoints in my…
D_CodeO1
  • 43
  • 5
3
votes
1 answer

Applying a positive/negative constraint to the coefficients of a quantile regression

In the package quantreg one can perform a penalized quantile regression. Selecting the variables that were deemed statistically significant is "easy". However, when I considered applying a restrain to the coefficients: i.e some to be strictly…
Hercules Apergis
  • 423
  • 6
  • 20
3
votes
1 answer

test whether coefficients in quantile regression model differ from each other significantly

I have a quantile regression model, where I am interested in estimating effects for the .25, .5, and .875 quantile. The coefficients in my model differ from each other in a way that is in line with the substantive substantive theory underlying my…
Peter Verbeet
  • 1,786
  • 2
  • 13
  • 29
3
votes
1 answer

anova.rq() in quantreg package in R

I'm interested in comparing estimates from different quantiles (same outcome, same covariates) using anova.rqlist function called by anova in the environment of the quantreg package in R. However the math in the function is beyond my rudimentary…
1
2 3 4 5 6 7