An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111105/dba92c6d/attachment.pl>
linear against nonlinear alternatives - quantile regression
8 messages · Julia Lira, David Winsemius, Roger Koenker +2 more
Just to address a piece of this - in the case in which you are currently focusing on only one quantile, the rms package can help by fitting restricted cubic splines for covariate effects, and then run anova to test for nonlinearity (sometimes a dubious practice because if you then remove nonlinear terms you are mildly cheating). require(rms) f <- Rq(y ~ x1 + rcs(x2,4), tau=.25) anova(f) # tests associations and nonlinearity of x2 Frank
Julia Lira wrote:
Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this issue, but they haven't been implemented at R. As far as I know, we only have two specification tests in this line: anova.rq and Khmaladze.test. The first one test equality and significance of the slopes across quantiles and the latter one test if the linear specification is model of location or location and scale shift. Do you have any suggestion? Thanks a lot! Best regards, Julia [[alternative HTML version deleted]]
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3993416.html Sent from the R help mailing list archive at Nabble.com.
I suppose this constitutes thread drift, but your simple example, Frank, made wonder if Rq() accepts a vector argument for tau. I seem to remember that Koencker's rq() does.. Normally I would consult the help page, but the power is still out here in Central Connecticut and I am corresponding with a less capable device. I am guessing that if Rq() does accept such a vector that the form of the nonlinearity would be imposed at all levels of tau.
David On Nov 5, 2011, at 10:43 AM, Frank Harrell <f.harrell at vanderbilt.edu> wrote: > Just to address a piece of this - in the case in which you are currently > focusing on only one quantile, the rms package can help by fitting > restricted cubic splines for covariate effects, and then run anova to test > for nonlinearity (sometimes a dubious practice because if you then remove > nonlinear terms you are mildly cheating). > > require(rms) > f <- Rq(y ~ x1 + rcs(x2,4), tau=.25) > anova(f) # tests associations and nonlinearity of x2 > > Frank > > Julia Lira wrote: >> >> Dear all, >> >> I would like to know whether any specification test for linear against >> nonlinear model hypothesis has been implemented in R using the quantreg >> package. >> >> I could read papers concerning this issue, but they haven't been >> implemented at R. As far as I know, we only have two specification tests >> in this line: anova.rq and Khmaladze.test. The first one test equality and >> significance of the slopes across quantiles and the latter one test if the >> linear specification is model of location or location and scale shift. >> >> Do you have any suggestion? >> >> Thanks a lot! >> >> Best regards, >> >> Julia >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@ mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > > ----- > Frank Harrell > Department of Biostatistics, Vanderbilt University > -- > View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3993416.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111105/09813570/attachment.pl>
Roger Koenker rkoenker at illinois.edu
On Nov 5, 2011, at 1:02 PM, Julia Lira wrote:
Dear David, Indeed rq() accepts a vector fo tau. I used the example given by Frank to run fitspl4 <- summary(rq(b1 ~ rcs(x,4), tau=c(a1,a2,a3,a4))) and it works. I even can use anova() to test equality of slopes jointly across quantiles. however, it would be interesting to test among different specifications, e.g. rcs(x,4) against rcs(x,3). but it does not work.
Probably because the models aren't nested...
Thanks for all suggestions! Julia
From: dwinsemius at comcast.net Date: Sat, 5 Nov 2011 13:42:34 -0400 To: f.harrell at vanderbilt.edu CC: r-help at r-project.org Subject: Re: [R] linear against nonlinear alternatives - quantile regression I suppose this constitutes thread drift, but your simple example, Frank, made wonder if Rq() accepts a vector argument for tau. I seem to remember that Koencker's rq() does.. Normally I would consult the help page, but the power is still out here in Central Connecticut and I am corresponding with a less capable device. I am guessing that if Rq() does accept such a vector that the form of the nonlinearity would be imposed at all levels of tau. -- David On Nov 5, 2011, at 10:43 AM, Frank Harrell <f.harrell at vanderbilt.edu> wrote:
Just to address a piece of this - in the case in which you are currently focusing on only one quantile, the rms package can help by fitting restricted cubic splines for covariate effects, and then run anova to test for nonlinearity (sometimes a dubious practice because if you then remove nonlinear terms you are mildly cheating). require(rms) f <- Rq(y ~ x1 + rcs(x2,4), tau=.25) anova(f) # tests associations and nonlinearity of x2 Frank Julia Lira wrote:
Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this issue, but they haven't been implemented at R. As far as I know, we only have two specification tests in this line: anova.rq and Khmaladze.test. The first one test equality and significance of the slopes across quantiles and the latter one test if the linear specification is model of location or location and scale shift. Do you have any suggestion? Thanks a lot! Best regards, Julia [[alternative HTML version deleted]]
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3993416.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Roger, It's nice to see a reply from the leader in quantile regression. I wonder if I might ask a somewhat unrelated question. A few recent papers have developed ways to force quantile regression curves not to cross. Do you have plans to implement this capability in quantreg? Thanks very much for developing such a fantastic package. Frank
Roger Koenker-3 wrote:
Roger Koenker rkoenker@ On Nov 5, 2011, at 1:02 PM, Julia Lira wrote:
Dear David, Indeed rq() accepts a vector fo tau. I used the example given by Frank to run fitspl4 <- summary(rq(b1 ~ rcs(x,4), tau=c(a1,a2,a3,a4))) and it works. I even can use anova() to test equality of slopes jointly across quantiles. however, it would be interesting to test among different specifications, e.g. rcs(x,4) against rcs(x,3). but it does not work.
Probably because the models aren't nested...
Thanks for all suggestions! Julia
From: dwinsemius@ Date: Sat, 5 Nov 2011 13:42:34 -0400 To: f.harrell@ CC: r-help@ Subject: Re: [R] linear against nonlinear alternatives - quantile regression I suppose this constitutes thread drift, but your simple example, Frank, made wonder if Rq() accepts a vector argument for tau. I seem to remember that Koencker's rq() does.. Normally I would consult the help page, but the power is still out here in Central Connecticut and I am corresponding with a less capable device. I am guessing that if Rq() does accept such a vector that the form of the nonlinearity would be imposed at all levels of tau. -- David On Nov 5, 2011, at 10:43 AM, Frank Harrell <f.harrell@> wrote:
Just to address a piece of this - in the case in which you are currently focusing on only one quantile, the rms package can help by fitting restricted cubic splines for covariate effects, and then run anova to test for nonlinearity (sometimes a dubious practice because if you then remove nonlinear terms you are mildly cheating). require(rms) f <- Rq(y ~ x1 + rcs(x2,4), tau=.25) anova(f) # tests associations and nonlinearity of x2 Frank Julia Lira wrote:
Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this issue, but they haven't been implemented at R. As far as I know, we only have two specification tests in this line: anova.rq and Khmaladze.test. The first one test equality and significance of the slopes across quantiles and the latter one test if the linear specification is model of location or location and scale shift. Do you have any suggestion? Thanks a lot! Best regards, Julia [[alternative HTML version deleted]]
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3993416.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3995819.html Sent from the R help mailing list archive at Nabble.com.
10 days later
I'm just curious if Professor Koenker responded to this (e.g. in an individual email or otherwise), as I would be interested in the answer. -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p4077713.html Sent from the R help mailing list archive at Nabble.com.
Sorry I didn't respond earlier. No, Rq does not take a vector tau. Frank
David Winsemius wrote:
I suppose this constitutes thread drift, but your simple example, Frank, made wonder if Rq() accepts a vector argument for tau. I seem to remember that Koencker's rq() does.. Normally I would consult the help page, but the power is still out here in Central Connecticut and I am corresponding with a less capable device. I am guessing that if Rq() does accept such a vector that the form of the nonlinearity would be imposed at all levels of tau. -- David On Nov 5, 2011, at 10:43 AM, Frank Harrell <f.harrell@> wrote:
Just to address a piece of this - in the case in which you are currently focusing on only one quantile, the rms package can help by fitting restricted cubic splines for covariate effects, and then run anova to test for nonlinearity (sometimes a dubious practice because if you then remove nonlinear terms you are mildly cheating). require(rms) f <- Rq(y ~ x1 + rcs(x2,4), tau=.25) anova(f) # tests associations and nonlinearity of x2 Frank Julia Lira wrote:
Dear all,
I would like to know whether any specification test for linear against
nonlinear model hypothesis has been implemented in R using the quantreg
package.
I could read papers concerning this issue, but they haven't been
implemented at R. As far as I know, we only have two specification tests
in this line: anova.rq and Khmaladze.test. The first one test equality
and
significance of the slopes across quantiles and the latter one test if
the
linear specification is model of location or location and scale shift.
Do you have any suggestion?
Thanks a lot!
Best regards,
Julia
[[alternative HTML version deleted]]
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p3993416.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@ mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p4078252.html Sent from the R help mailing list archive at Nabble.com.