From marc_grt at yahoo.fr  Wed Aug 23 14:12:53 2017
From: marc_grt at yahoo.fr (Marc Girondot)
Date: Wed, 23 Aug 2017 14:12:53 +0200
Subject: [Rd] MASS:::dropterm.glm() and MASS:::addterm.glm() should use
 ... for extractAIC()
In-Reply-To: <89d0ae23-3560-8c1a-fcd9-4ead33a49496@yahoo.fr>
References: <89d0ae23-3560-8c1a-fcd9-4ead33a49496@yahoo.fr>
Message-ID: <ec5ad8c4-31c0-3213-8ea8-73547adfa773@yahoo.fr>

Hi,
I have sent this message to this list the July, 7th. It was about a 
problem in MASS package.
Until now there is no change in the devel version.
As the problem occurs in a package and not in the R-core, I don't know 
if the message should have been sent here. Anyway, I have added a copy 
to Pr Ripley.
I hope it could have been fixed.
Sincerely
Marc

Le 09/07/2017 ? 16:05, Marc Girondot via R-devel a ?crit?:
> Here is a change required from MASS:::dropterm.glm() and 
> MASS:::addterm.glm().
>
> Thanks
>
> Marc
>
>
> The stepAIC() function from package MASS uses extractAIC() to get the 
> AIC from a model.
> Several methods exist:
> extractAIC.glm() for example, some in MASS packages and some in stats 
> package.
>
> The parameters for extractAIC() are:
> fit, scale, k = 2, ...
>
> The ... are not used in most of the extractAIC.xxx() methods, from 
> example in stats:::extractAIC.glm() or MASS:::extractAIC.loglm() but 
> its presence could be necessary if extractAIC() is changed to use for 
> example to use AICc rather than AIC.
>
> Within stepAIC(), extractAIC() uses always the ... parameter. So all 
> is ok for that.
>
> However, stepAIC() uses dropterm() or addterm().
>
> Within MASS:::dropterm.glm() and MASS:::addterm.glm(), extractAIC() is 
> also used but without the ... parameter.
>
> It prevents to use new version of extractAIC() that could use this 
> parameter.
>
> The solution is simple:
> In MASS:::dropterm.glm(), line 60 and MASS:::addterm.glm(), line 84:
> aic <- aic + (extractAIC(object, k = k)[2L] - aic[1L])
> must be changed to
> aic <- aic + (extractAIC(object, k = k, ...)[2L] - aic[1L])
>
> Other dropterm.xxx() and addterm.xxx() do not suffer this problem.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Marc Girondot