[R] Pearson residuals

Henric Nilsson (Public) nilsson.henric at gmail.com
Sat Nov 3 22:26:24 CET 2007


Jorge Manuel de Almeida Magalhães wrote:
>>
>>
>> Jorge Manuel de Almeida Magalhães wrote:
>>> Dear Sirs
>>>
>>> What is the best aproximation to the standardized normal distribution:
>>>
>>>
>>  How about
>>
>> http://www.statsci.org/s/qres.html
>>
>> (which gives S-PLUS code: haven't checked to see if it works in R
>> or not, but it looks like it probably will)

Code for randomized quantile residuals do exist for R as part of Gordon 
Smyth's `statmod' package. See `?qresiduals'.


HTH,
Henric



>>
>>    My other question is how much you should expect to derive
>> strong conclusions from the residuals from this small a data set ...
> 
> You are reason. Such date is a example. The p-value ( 0.043518) it is 
> inconsistency with the Pearson Residuals:
>                        CE-1      CE-2       CE-3
> sem necessidade -0.4309469 0.3576286 -0.3069599
> com necessidade  0.2547359 1.8561316 -1.5403424
> 
> We can compare them against standard normal critical values such as 
> 1.96. All residuals are in range -1,96, +1.96.
> 
> But, if I do
> 
> n*resid.pear.mat/sqrt(outer(n-ni,n-nj,"*"))
> 
>                        CE-1       CE-2      CE-3
> sem necessidade -0.6701451 -0.6569159  2.497185
> com necessidade  0.6701451  0.6569159 -2.497185
> 
> I found that the group CE-3 is responsible by the lack of the 
> independence model. This is consistency with the p-value.
> 
> ______________________________________________
> 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