[R] nlrq coefficients querry

roger koenker roger at ysidro.econ.uiuc.edu
Wed Jan 16 04:52:19 CET 2008


The posting guide suggests writing to the package maintainer
before writing to r-help.  The discrepancy between the two tables
has a relatively simple explanation.  The former version of the
table has the usual interpretation:

      Value    Std. Error t value  Pr(>|t|)
Asym 12.17954  0.26831   45.39386  0.00000
mid  12.00469  0.15866   75.66266  0.00000
scal  2.01453  0.09097   22.14380  0.00000

However the latter version is based entirely on the  linearized version
of the model used for the bootstrapping and therefore the coefficients
are now the coefficients in the linearized version of the model so the
se's are correct, but the coefficients are not.  The latter version of  
the
is not equivalent to the former and shouldn't produce the same table.

              Value Std. Error     t value  Pr(>|t|)
XAsym -0.008072651 0.28054914 -0.02877446 0.9770560
Xmid  -0.002706786 0.16781543 -0.01612954 0.9871375
Xscal -0.017474990 0.09857118 -0.17728296 0.8593584




On Jan 15, 2008, at 8:28 PM, Jeremy VanDerWal wrote:

> I have been quantreg library for a number of projects but have just  
> hit a
> snag. I am using nlrq to examine an asymptotic relationship between 2
> variables at the 99th percentile. It performs as expected, however  
> when I
> try to extract the coefficients along with se and significance I am  
> running
> into problems. The problem is that for the nlrq regression Dat.nlrq,
> summary(Dat.nlrq) reports a different coefficients table than summary(
> Dat.nlrq)$coefficients.
>
> Below is a series of syntax (mostly from the nlrq sample script)  
> reproducing
> the error.
>
> ########################################################
> # get the necessary libraries
> library(quantreg)
>
> #code from the example of nlrq documentation
> Dat <- NULL; Dat$x <- rep(1:25, 20)
> set.seed(1)
> Dat$y <- SSlogis(Dat$x, 10, 12, 2)*rnorm(500, 1, 0.1)
> plot(Dat)
>
> Dat.nlrq <- nlrq(y ~ SSlogis(x, Asym, mid, scal), data=Dat, tau=0.975,
> trace=TRUE)
> lines(1:25, predict(Dat.nlrq, newdata=list(x=1:25)), col=4)
>
> #code demonstrating the error...
> print(summary( Dat.nlrq))
> print(coef(Dat.nlrq)) #coefficients are the same as above
> print(summary(Dat.nlrq)$coefficients) #coefficients differ from  
> previous 2
> commands
> ########################################################
>
> I am using R2.5.1 with quantreg 4.10 on an 64-bit xp system. I have  
> verified
> this same error occurs on an 32-bit xp system.
>
> Any suggestion to correct this, or as a work-a-round would be greatly
> appreciated.
>
> Cheers,
>
> Jeremy
>
> 	[[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.




More information about the R-help mailing list