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
2
votes
0 answers

R and quantreg : Unbalanced residuals

I'm trying to use the quantreg package to fit an exponential curve. Here is a reproductible example. IRL I have much more complex data with outliers, that's why I prefer not using nls which is not robust to…
user3904098
2
votes
2 answers

using nlrq with SSexp is generating this error: "Error in getInitial(formula, mf) : unused argument (mf)"

I have been trying to fit non linear quantile regression model with nlrq() (from quantreg package). But what I found that the function is very sensitive to starting values. So I tried to use self starter SSexp() with it. What I read that self…
2
votes
1 answer

R returning zero / NULL coefficients with quantreg quantile regression package

I am using the quantreg package to compute quantile regressions in R. I invoke my QR using the following command. quantGsReg15 <- rq(gsRMSD ~ kMeanGrp + medianDurationMS + flightHours + flightHoursType + landings30days +…
florian
  • 604
  • 8
  • 31
2
votes
1 answer

How to see a .Fortran function in quantreg package

I was trying to see the source code of function "crq.fit.pen" in quantreg package. For that reason, I try to do the following jobs. At first I just entered the name of function, the results is given below, crq.fit.pen <- function (x, y, cen,…
2
votes
2 answers

How to set se=boot when using texreg for quantile regression in R?

I am running quantile regression (package quantreg) and using texreg to create a latex output of my models. I am interested in bootstrapped s.e. and set se="boot" in the options of summary but when I use texreg I get "n.i.d." s.e. How do I change…
1
vote
0 answers

Is there a difference between summary() and stargazer() by calculating standard error?

Recently I have used quantreg::rq() to estimate a quantile regression. It returns the following error when using summary(): Error in base::backsolve(r, x, k = k, upper.tri = upper.tri, transpose = transpose, : singular matrix in 'backsolve'. First…
Fang
  • 23
  • 3
1
vote
2 answers

Misuse predict.rq in the package quantreg?

I am using quantreg package to predict new data based on training set. However, I noticed a discrepancy between predict.rq or predict and doing it manually. Here is an example: The quantile regression setting is N = 10000 tauList =…
tobinz
  • 117
  • 1
  • 9
1
vote
1 answer

Can't display x and y labels, when plotting with the quantreg command

I'm trying to plot the result of the quantreg command, but the labels of the graph don't show up. I'm running this code: plot(summary(qrg), parm="agua_esgoto", xlab = "Quantiles", ylab = "Piped water and sewage", main = "Figure 1") This is the…
Mateus Maciel
  • 151
  • 1
  • 1
  • 10
1
vote
0 answers

Get significance level (p-value) of a model with quantreg

set.seed(5) library(quantreg) d <- data.frame(x=seq(-5, 5, len=51)) d$y <- 50 - 0.3*d$x^2 + rnorm(nrow(d)) Taus <- c(0.1,0.3,0.5,0.7,0.9) QR<-rq(y ~ 1 + x + I(x^2)+I(x^3), tau=Taus, data=d) I need to find the p-value for the estimated…
Hanan
  • 33
  • 1
  • 5
1
vote
2 answers

Combining LOESS and Quantreg to caculate percentiles/quantiles for data

I am trying to calculate percentiles or quantils for data which considerably scatter. Using the Loess function the mean is nicely presented, however, I cannot get percentile/quantils from this function. I tried to combine quantreg with loess. This…
Niels
  • 141
  • 12
1
vote
1 answer

Anova: Warning: In summary.rq(x, se = se, covariance = TRUE) : 2 non-positive fis

I ran the following script to analyse a nonparametric quantile regression using quantreg package: library (quantreg) model.q = rq(Y_var ~ X1_var + X2_var + X3_var, data = wideformat_data, tau =…
Rei
  • 21
  • 6
1
vote
1 answer

Obtaining fitted values from second-order quantile regressions

I'm sure this is easily resolvable, but I have a question regarding quantile regression. Say I have a data frame which follows the trend of a second-order polynomial curve and I construct a quantile regression fitted through different parts of the…
James White
  • 705
  • 2
  • 7
  • 20
1
vote
0 answers

Converting data to percentage rank

I have data whose mean and variance changes as a function of the independent variable. How do I convert the dependent variable into (estimated) conditional percentage ranks? For example, say the data looks like Z…
banbh
  • 1,331
  • 1
  • 13
  • 31
1
vote
1 answer

R quantreg model does not reproduce quantiles: Why?

I am using the quantreg package to predict quantiles and their confidence intervals. I can't understand why the predicted quantiles are different from the quantiles calculated directly from the data using…
Simon Woodward
  • 1,946
  • 1
  • 16
  • 24
1
vote
2 answers

Plotting quantile regression by variables in a single page

I am running quantile regressions for several independent variables separately (same dependent). I want to plot only the slope estimates over several quantiles of each variable in a single plot. Here's a toy data: set.seed(1988) y <- rnorm(50, 5,…
Enigma
  • 139
  • 3
  • 15