segmented quantile regression and rqss

classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

segmented quantile regression and rqss

Griffith.Michael

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:  [hidden email]

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: segmented quantile regression and rqss

stephen cox-3
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,  <[hidden email]> 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:  [hidden email]
>
>  _______________________________________________
>  R-sig-ecology mailing list
>  [hidden email]
>  https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: segmented quantile regression and rqss

Matthew Landis-2
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: [hidden email]
>[mailto:[hidden email]] On Behalf Of
>Stephen B. Cox
>Sent: Friday, May 02, 2008 10:33 AM
>To: [hidden email]
>Cc: [hidden email]
>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,
><[hidden email]> 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:  [hidden email]
>>
>>  _______________________________________________
>>  R-sig-ecology mailing list
>>  [hidden email]
>>  https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>_______________________________________________
>R-sig-ecology mailing list
>[hidden email]
>https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Loading...