[R-sig-eco] segmented quantile regression and rqss

Landis, R Matthew rlandis at middlebury.edu
Fri May 2 17:40:40 CEST 2008


A simpler option might be to try the lsp function in Design.  It seems to get along with quantreg OK. For example, try:

data(engel)
attach(engel)
fit <- rq(foodexp ~ lsp(income, 3000), tau = 0.5)
plot(income, foodexp)
lines(lowess(income, fitted(fit)))

Matt Landis

****************************************************
R. Matthew Landis, Ph.D.
Dept. Biology
Middlebury College
Middlebury, VT 05753

tel.: 802.443.3484
**************************************************


>-----Original Message-----
>From: r-sig-ecology-bounces at r-project.org
>[mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of
>Stephen B. Cox
>Sent: Friday, May 02, 2008 10:33 AM
>To: Griffith.Michael at epamail.epa.gov
>Cc: r-sig-ecology at r-project.org
>Subject: Re: [R-sig-eco] segmented quantile regression and rqss
>
>Not sure if this is what you are looking for, but just try
>something like:
>
>m = nlrq(y~g0+g1*x*(x<=bp) + (g1 * bp + b1 * (x-bp))*(x>bp),
>data=data, tau=.9,start=list(g0=1,g1=10,b1=-1,bp=5))
>
>where 'bp' is the breakpoint between the two segments.  Obviously -
>your starting values would change to fit your needs.
>
>HTH
>
>Stephen
>
>--
>Stephen B. Cox
>Dept. Env. Tox
>TTU
>
>
>On Fri, May 2, 2008 at 8:38 AM,
><Griffith.Michael at epamail.epa.gov> wrote:
>>
>>  We have been investigating quantile regression for
>developing stressor -
>>  response relationships from stream monitoring data.  I
>would like to add
>>  a segmented model to our analyses to look for thresholds in these
>>  relationships.  I have figured out how to fit a model composed of
>>  multiple linear segments using rqss.  Koenker gives an
>example in the
>>  vignette for Quantile Regression in R.  However, I would
>like to fit a 2
>>  - segment model.  Can anyone give me pointers on how this
>might be done?
>>
>>  Michael
>>
>>  Michael B. Griffith, Ph.D.
>>  Research Ecologist
>>
>>  USEPA, NCEA (MS A-110)
>>  26 W. Martin Luther King Dr.
>>  Cincinnati, OH  45268
>>
>>  telephone:  513 569-7034
>>  e-mail:  griffith.michael at epa.gov
>>
>>  _______________________________________________
>>  R-sig-ecology mailing list
>>  R-sig-ecology at r-project.org
>>  https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>_______________________________________________
>R-sig-ecology mailing list
>R-sig-ecology at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



More information about the R-sig-ecology mailing list