[R] quantile regression problem

roger koenker roger at ysidro.econ.uiuc.edu
Sat Dec 10 18:55:02 CET 2005


Since almost all (95%) of the observations are concentrated at x=0  
and x=1,
any fitting you do is strongly influenced by what would be obtained
by simply fitting quantiles at these two points and interpolating, and
extrapolating according to your favored model.  I did the following:

require(quantreg)
formula <- log(y) ~ x

plot(x,y)
z <- 1:30/10
for(tau in 10:19/20){
         f <- rq(formula,tau = tau)
         lines(z,exp(cbind(1,z) %*% f$coef))
         }


url:    www.econ.uiuc.edu/~roger                Roger Koenker
email   rkoenker at uiuc.edu                       Department of Economics
vox:    217-333-4558                            University of Illinois
fax:    217-244-6678                            Champaign, IL 61820


On Dec 10, 2005, at 11:30 AM, zuzmun at natur.cuni.cz wrote:

> Dear List members,
>
> I would like to ask for advise on quantile regression in R.
>
> I am trying to perform an analysis of a relationship between  
> species abundance and its habitat requirements -
> the habitat requirements are, however, codes - 0,1,2,3... where  
> 0<1<2<3 and the scale is linear - so I would be happy to treat them  
> as continuos
>
> The analysis of the data somehow does not work, I am trying to  
> perform linear quantile regression using rq function and I cannot  
> figure out whether there is a way to analyse the data using  
> quantile regression ( I would really like to do this since the  
> shape is an envelope) or whether it is not possible.
>
> I tested that if I replace the categories with continuous data of  
> the same range it works perfectly. In the form I have them ( and I  
> cannot change it) I am getting
>  errors - mainly about non-positive fis.
>
> Could somebody please let me know whether there was a way to  
> analyse the data?
> The data are enclosed and the question is
> Is there a relationship between abundance and absdeviation?
> I am interested in the upperlimit so I wanted to analyze the upper 5%.
>
> Thanks a lot for your help
>
> All the best
>
> Zuzana Munzbergova
>
> www.natur.cuni.cz/~zuzmun
> <GSS1a.txt>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting- 
> guide.html




More information about the R-help mailing list