I am performing quantile regressions in R using the package quantreg. My dataset includes 12,328 observations ranging from 0.12 to 330. The timepoints for my data are not exactly continuous; all data fall into one of a few dozen bins ranging from 73 to 397.
When I performed a linear regression on this data using the lm() function, I was able to do this with polynomials up to 4:
lm(Y~poly(X,3,raw=TRUE),data=mydata)
However, with the package quantreg and the rq() command, I cannot use any polynomials. A simple regression works just fine:
rq(Y~X,data=mydata,tau=.15)
But as soon as I get into polynomials, no dice. When I enter this:
rq(Y~poly(X,2,raw=TRUE),data=mydata,tau=.15)
I get the following error message:
Error in rq.fit.br(x, y, tau = tau, ...) : Singular design matrix
I've read up on singular matrices, and I think there might be two reasons for this: (1) I only have one variable on each axis, or (2) my data are binned/the Y variable isn't truly continuous.
Can anyone tell me why I'm getting this error?
PS - This is how the graph looks: