4:21 M ˆl–äY>”Ëm �Á à›S�ÿ�þDã#Y²´ËòŒQÈ6�üÿÅ ƒ}לÄa–ßi~”T¾R( ÅÍÁ3q§TÅ£È&: The Quantreg FAQ 1. [Non-uniqueness of Solutions] "The estimation of regression quantiles is a linear programming problem. And the optimal solution may not be unique. However, rq() provides a single solution. My question is what are the additional constraints to get the single solution? Because when we do the research, we can write our own routine in different software like in SAS to estimate quantile regression, does that mean people will get different solutions?" From ?rq.fit.fn: eps: tolerance parameter for convergence. In cases of multiple optimal solutions there may be some discrepancy between solutions produced by method '"fn"' and method '"br"'. This is due to the fact that '"fn"' tends to converge to a point near the centroid of the solution set, while '"br"' stops at a vertex of the set. There is already facility for doing QR in SAS and it is based _very_closely_ on my R package and uses essentially the same algorithms. 2. [Non-uniqueness redux] "And all these solutions is [sic] correct? Or do we need additional constraints to get the same solutions as derived in R?" Yes, they are all correct. Just as any number between the two central order statistics is "a median" when the sample size is even and the order statistics are distinct. The main point here is that the differences between solutions are of order 1/n and the inherent uncertainty about the estimates is of order 1/sqrt(n) so the former variability is essentially irrelevant. 3. [Basic Obervations] "How can we identify the cases (data pairs) that belong to different quantiles in a scatterplot? It seems that they must be identified by the code in the process of analyzing the quantile means, but I've been unable to figure out how to find and extract them." For a given fit: f <- rq(y ~ x +z, tau = .4) h <- which(abs(f$resid) < tol) will recover the indices of the observations that have zero residuals. Of course you need to specify tol which I would recommend to be something like: tol <- .Machine$double.eps^(2/3) If f has p fitted parameters then h should have p elements. If this isn't the case then you might need to experiment with tol a bit. 4. [R^2] "I am currently trying to caculate the coefficient of determination for different quantile regression models. For example, how do you calculate the the sum of the weighted absolute deviations in the models ..." R-squared is evil, that is why there isn't an automated way to compute something similar for quantile regression in the quantreg package. But if you insist use: R1 <- 1 - f1$rho/f0$rho Provided that f0 is nested within f1 and the taus are the same, 0 <= R1 <= 1. If you want to test f1 vs f0 then use anova(f1,f0) For further details see: Koenker R. and Jose A.F. Machado. Goodness of Fit and Related Inference Processes for Quantile Regression J. of Am Stat. Assoc, (1999), 94, 1296-1310. 4a. [R^2 redux] "I am very interested in the coefficient of determination for different quantile regression models. And, I have f1, but don't know what is f0, so that I failed to run R1 in your FAQ 4. Could you please help me solve my question?" f0 could be any nested fit, but usually it would be rq(y ~ 1, ...) a model with only an intercept that returned unconditional quantile estimates. 5. [Singular Designs] "R crashes in some cases when fitting models with rq()." This happened in some earlier versions of the package when the design matrix was singular. This is now checked more carefully, and shouldn't happen in versions 4.17 or later. Eventually, I may try to treat singular designs in a way that is more compatible with lm(). 6. [Confidence Intervals] "Why does summary(rq(...)) sometimes produce a table with upper and lower confidence limits, and sometimes a table with standard er