From smyth at wehi.EDU.AU  Fri Mar 18 02:32:45 2011
From: smyth at wehi.EDU.AU (Gordon K Smyth)
Date: Fri, 18 Mar 2011 12:32:45 +1100 (AUS Eastern Daylight Time)
Subject: [Rd] Standardized Pearson residuals (and score tests)
In-Reply-To: <1ED94EBF-B9D3-4763-AB82-17B540ED2FF1@gmail.com>
References: <mailman.27.1300273207.30527.r-devel@r-project.org>
	<Pine.WNT.4.64.1103170923580.4296@PC765.wehi.edu.au>
	<1ED94EBF-B9D3-4763-AB82-17B540ED2FF1@gmail.com>
Message-ID: <Pine.WNT.4.64.1103181220450.5620@PC765.wehi.edu.au>

On Thu, 17 Mar 2011, peter dalgaard wrote:

> On Mar 16, 2011, at 23:29 , Gordon K Smyth wrote:
>
>> Hi Peter and others,
>>
>> If it helps, I wrote a small function glm.scoretest() for the statmod 
>> package on CRAN to compute score tests from glm fits.  The score test 
>> for adding a covariate, or any set of covariates, can be extracted very 
>> neatly from the standard glm output, although you probably already know 
>> that.
>
> Thanks Gordon,
>
> I'll have a look. It's the kind of think where you _strongly suspect_ 
> that a neat solution exists, but where you can't just write it down 
> immediately. Looks like your code needs some elaboration to handle 
> factor terms and more general model reductions, though.

Yes, the glm.scoretest() function is very basic.  At the moment it tests 
for adding a single covariate at a time, i.e., a 1 df test, or several 1 
df tests.  If you like, I could add a multiple column version that would 
work for factors etc, it would be only more line or so.  I figure you'd 
want to pull code out of glm.scoretest() rather than call it explicitly 
anyway.

Gordon

> -pd
>
>>
>> Regards
>> Gordon
>>
>> ---------------------------------------------
>> Professor Gordon K Smyth,
>> NHMRC Senior Research Fellow,
>> Bioinformatics Division,
>> Walter and Eliza Hall Institute of Medical Research,
>> 1G Royal Parade, Parkville, Vic 3052, Australia.
>> smyth at wehi.edu.au
>> http://www.wehi.edu.au
>> http://www.statsci.org/smyth

> -- 
> Peter Dalgaard
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
>
>

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



[Rd] Standardized Pearson residuals (and score tests)
Gordon K Smyth