[R] How do we get two-tailed p-values for rlm?

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jan 19 07:56:38 CET 2008


On Fri, 18 Jan 2008, Darren Weber wrote:

> How do we get 2-tailed p-values for the rlm summary?
>
> I'm using the following:
>
>>   fit <- rlm(oatRT ~ oatoacData$erp, psi=psi.bisquare, maxit=100,
> na.action='na.omit')
>>   fitsum <- summary(fit, cor=F)
>>   print(fitsum)
>
> Call: rlm(formula = oatRT ~ oatoacData$erp, psi = psi.bisquare, maxit = 100,
>
>   na.action = "na.omit")
> Residuals:
>    Min       1Q   Median       3Q      Max
> -120.616  -50.637   -5.895   60.356  199.066
>
> Coefficients:
>              Value    Std. Error t value
> (Intercept)    574.5204  25.8582    22.2181
> oatoacData$erp  11.5963   5.3525     2.1665
>
> Residual standard error: 83.29 on 36 degrees of freedom
> (2 observations deleted due to missingness)
>>   i <- length(fitsum$coefficients) - dim(fitsum$coefficients)[1] + 1
>>   j <- length(fitsum$coefficients)
>>   tvalues <- fitsum$coefficients[i:j]
>>   pvalues <- pt(tvalues, df=fitsum$df[2])
>>   print(rbind(tvalues, pvalues))
>           [,1]      [,2]
> tvalues 22.21815 2.1664977
> pvalues  1.00000 0.9815145
>
>
> If I use the lower.tail=FALSE argument to pt, then I seem to get only the
> p-values for anything > my t value.  Do have to call pt twice, once with
> lower.tail=TRUE and once with lower.tail=FALSE to get 2-tailed p-values?

The t distribution is symmetric, so you just double the upper tail value.
(See the code of summary.lm for how it does this.)

BUT, what justifies the assumption of a t distribution here?
Even for lm, the calculations rely on a normal distribution of errors, and 
robust methods are used precisely to avoid that.
rlm() is support software for a book, and this issue and alternatives 
(e.g. bootstrapping) are discussed there.

>
> Thanks in advance, Darren
>
> 	[[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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list