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

R quantreg : boundary condition rq() function goes into infinite loop

I'm facing a problem that rq(y ~ x, tau = 0.50, method = "br") doesn't complete calculation. There is no error and warning. I traced code and found .Fortran() in rq.fit.br() does not finish calculation. I'm not familiar with Fortran so let me ask…
kabocha
  • 133
  • 7
0
votes
1 answer

Is possible to find prediction interval using quantile regression?

When trying to run the below code predict, it gives me an error saying interval arg should be none or confidence and so I am wondering if there is a way to get prediction interval using quantile regression? Note: If I replace the rq with lm I am…
Gokul
  • 41
  • 7
0
votes
0 answers

quantregForest setting seed

I am trying to run reproducible results with quantregForest but can't get the same results. Is there a way of setting the seed in this function? x <- matrix(rnorm(500), ncol = 10) y <- rnorm(50) nodesize = floor(length(y) / 4) set.seed(71) a <-…
Anon.user111
  • 468
  • 1
  • 5
  • 16
0
votes
1 answer

How can I generate data to show difference between quantile and linear regression

I want to generate data to show how quantile regression can be useful, in particular when linear regression shows that there is no (mean) correlation between two variables, but there is a correlation in the upper and/or lower quantiles of data. It…
0
votes
1 answer

Plotting Quantile regression with full range in ggplot using facet_wrap

So I would like to plot entire full range quantile lines in full range when using facet_wrap. The code goes as follows: library(tidyverse) library(quantreg) mtcars %>% gather("variable", "value", -c(3, 10)) %>% ggplot(aes(value, disp)) + …
Petr
  • 1,606
  • 2
  • 14
  • 39
0
votes
1 answer

How to specify custom quantiles in quantreg's cqr (censored quantile regression) function?

library("quantreg") In ordinary quantile regression with qr we can specify custom quantiles by option tau. rq(y ~ x, tau=c(.1, .5, .9)) # Call: # rq(formula = y ~ x, tau=c(0.1, 0.5, 0.9)) # # Coefficients: # tau= 0.1 tau= 0.5 tau=…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
0
votes
0 answers

how to interpret a non linear regression in R

I made a non linear regression in R (package quantreg) and obtained the following result: Coefficients: Value Std. Error t value Pr(>|t|) Asym 30.98339 1.06558 29.07656 0.00000 mid 36.18334 1.49832 24.14935 0.00000 scal 1.75042 …
Agus camacho
  • 868
  • 2
  • 9
  • 24
0
votes
1 answer

Unable to use RAM memory in quantreg

I'm trying to run quantreg with 2 independent variables over the 12 555 029 cases. I have 16GB RAM on computer, 64Bit OS. Command memory.limit() returned 16 264. Command sessionInfo() returned: R version 3.5.2 (2018-12-20) Platform:…
Boriana
  • 1
  • 6
0
votes
1 answer

Censored least absolute deviation (CLAD) regression using CRQ in library QUANTREG

I would like to perform a CLAD regression with y = EQ-5D-5L utility scores (bounded from above by 1.0) x = various patient characteristics I already found out that I need to use CRQ in the library QUANTREG, but I couldn't figure out the specifics…
JuliA
  • 1
  • 2
0
votes
1 answer

Plot lqmm functions

I am struggling to find examples online as to how lqmm models can be easily plotted. So for example, below, I would like a simple plot where I can predict multiple quantiles and overlay these predictions onto a scatterplot: library(lqmm) …
James White
  • 705
  • 2
  • 7
  • 20
0
votes
1 answer

How get plot from nlrq in R?

Following workflow for nonlinear quantile regression seems to work. However I don´t know how to plot the resulting curve. btw.: I´d prefer to use the function graphics::curve() instead of graphics::lines() require(quantreg) # load sample data dat…
N'ya
  • 347
  • 3
  • 13
0
votes
1 answer

Using .Fortran() from R package with error saying function not available

I tried the following codes: library(quantreg) # to load the package library(foreign) # to load the package .Fortran("rqfn", PACKAGE = "quantreg") but I get the following error: Error in .Fortran("rqfn", PACKAGE = "quantreg") : "rqfn" not…
Sheng Bi
  • 149
  • 4
  • 12
0
votes
0 answers

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

This is an extension from this question about 95% confidence intervals for quantile regression using rquant: Calculating 95% confidence intervals in quantile regression in R using rq function Here, the goal is to determine 95% confidence intervals…
Minnow
  • 1,733
  • 2
  • 26
  • 52
0
votes
2 answers

Using a quantile regression to fit stock data

I am trying to implement the quantreg Quantile Regression function on data I retrieved from Yahoo. It appears I need to perform a procedure on the stock data so that the rq() function can read the data. I am not sure how to do this. My question is…
0
votes
1 answer

Unable to install quantreg package and update R version

I am using R version 3.3.1 on RStudio interface, and a Windows 10 OS. I was trying to install the 'quantreg' package for quantile regression, however I was getting the error message Warning in install.packages : InternetOpenUrl failed: 'The…