0

I am using quantreg package in R for running quantile regression (95%) on a set of data.

I would like to set the slope of of the quantile regression to the value 1.4, as alreday did in a previous analysis with which I want to compare my outcomes. If in lm() this is possible with the function offset(), using rq() for a fixed quantiles (e.g. 0.025) this does not work.

The code doesn't give error, but the value of 1.4 doesn't have an effect on my results.

fit.0.025<-rq(y~offset(1.4*x),tau=0.025, data=mydataframe)
lmo
  • 37,904
  • 9
  • 56
  • 69
refroll
  • 131
  • 1
  • 9

1 Answers1

0

Shouldn't this be something like this inadequately tested code? (.. unless the intercept column is suppressed it will still be a parameter to be estimated, defeating the effort to 'fix' it.) (Edited, need to repeat the offset and use -1 instead of +0)

   dfrm <- data.frame(x=runif(1000, 1,100), y=runif(1000, 1,2))
   fit.0.025 < -rq(y ~ x*(1 + offset( rep(1.4, 1000) ) ) -1, tau=0.025, data=dfrm)

# Same as:
fit.0.025<-rq(y ~ x + offset( rep(1.4, 1000)) -1 , tau=0.025, data=dfrm)

Quite honestly, I'm questioning whether this makes any statistical sense. It's not always the case that getting mathematical operations to run produces interpretable output.

I earlier typed:

fit.0.025<-rq(y ~ x+ offset(1.4), tau=0.025, data=mydataframe)

.... but that would only have been appropriate for a multiplicative link.

IRTFM
  • 258,963
  • 21
  • 364
  • 487