r - Unexpected quantile relationship -
i want fit quantile regression model observed data, show triangular relationship between response , predictor variables:
when do:
library("quantreg") m1 <- rq(y~ x, tau = 0.75, data=mydata) summary(m1) call: rq(formula = y ~ x, tau = 0.75, data = mydata) tau: [1] 0.75 coefficients: coefficients lower bd upper bd (intercept) 3.42758 1.80850 4.74463 x 0.27879 0.07132 0.82591
it founds positive relationship (in red), when should negative looking @ points in graph, right? maybe i'm missing looks wrongh tau value. tried t=0.97 , t=0.90 (in gray), same pattern produced.
then, when do:
m1.all <- rq(y~ x, tau = seq(0.05, 0.95, = 0.05), data=mydata) m1.plot <- summary(m1.all)
warning messages:
1: in rq.fit.br(x, y, tau = tau, ci = true, ...) :
solution may nonunique
2: in rq.fit.br(x, y, tau = tau, ci = true, ...) :
solution may nonunique
3: in rq.fit.br(x, y, tau = tau, ci = true, ...) :
solution may nonunique
4: in rq.fit.br(x, y, tau = tau, ci = true, ...) :
solution may nonunique
plot(m1.plot)
error in plot.window(...) : infinite axis extents [gepretty(-inf,inf,5)]
i obtain plot intercept, not coefficients.
what i'm doing wrong?
i provide here mydata. expect negative relationship similar results shown cade & noon 2003 in fig. 1 (see here).
Comments
Post a Comment