Re: [R] quantile regression problem

From: roger koenker <roger_at_ysidro.econ.uiuc.edu>
Date: Sun 11 Dec 2005 - 04:55:02 EST

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@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@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@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



R-help@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 Received on Sun Dec 11 05:03:05 2005

This archive was generated by hypermail 2.1.8 : Sun 11 Dec 2005 - 09:29:39 EST