[S] maxit specification with stepAIC

Matthieu Lesnoff (lesnoff@hpbaill.cirad.fr)
Tue, 15 Sep 1998 15:06:21 +0200


Hello,

I have some problems to fix the iteration number (maxit) with the stepAIC
function (library MASS) in glm treatements for ML estimations.

In a first application, I fix maxit=5 (with the control option) :

I obtain theses understood warnings msg :">Warning messages:
> Warning in glm.fitter(x = X, y = Y, w = w, start = start, offset =
offset, : linear
> convergence not obtained in 5 iterations."

But, in addition, I obtain theses misunderstood warning msg :">Warning
messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
> convergence not obtained in 10 iterations."

In a second application, I fix maxit=100 (with the control option) :

But I obtain again theses misunderstood warning msg :">Warning messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
> convergence not obtained in 10 iterations."

The specification of maxit seems not to be taken into account (???).

Thank you if somebody could explain that.

----------------------------------------------------------------------------
---------------------

FIRST APPLICATION (-> maxit is fixed to 5)
__________________

g <- glm(pmor ~ (sex + vphase1 + vstade4)^2, family = binomial(link =
cloglog), weights = nbini, control = glm.control(maxit = 5), data = data1)

>Warning messages:
> Warning in glm.fitter(x = X, y = Y, w = w, start = start, offset =
offset, : linear
> convergence not obtained in 5 iterations.

stepg <- stepAIC(g, direction = "backward", trace = T)

>Start: AIC= 510.19
> pmor ~ (sex + vphase1 + vstade4)^2

>Warning messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
>convergence not obtained in 10 iterations.

>Warning messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
> convergence not obtained in 10 iterations.

> Df Deviance AIC
>- vphase1:vstade4 121 303.0781 395.0781
> - sex:vstade4 11 117.2860 429.2860
> - sex:vphase1 11 122.7776 434.7776
> <none> 176.1876 510.1876

>Warning messages:
> Warning in glm.fitter(x = X, y = Y, w = w, start = start, offset =
offset, : linear
> convergence not obtained in 5 iterations.

>Step: AIC= 416.83
> pmor ~ sex + vphase1 + vstade4 + sex:vphase1 + sex:vstade4

> Df Deviance AIC
>- sex:vstade4 11 312.1739 382.1739
>- sex:vphase1 11 317.5660 387.5660
> <none> 324.8286 416.8286

>Warning messages:
> Warning in glm.fitter(x = X, y = Y, w = w, start = start, offset =
offset, : linear
> convergence not obtained in 5 iterations.

SECOND APPLICATION (-> maxit is fixed at 100)
____________________

g <- glm(pmor ~ (sex + vphase1 + vstade4)^2, family = binomial(link =
cloglog), weights = nbini, control = glm.control(maxit = 100), data = data1)

stepg <- stepAIC(g, direction = "backward", trace = T)

Start: AIC= 441.74
pmor ~ (sex + vphase1 + vstade4)^2

>Warning messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
> convergence not obtained in 10 iterations.
>Warning messages:
> Warning in glm.fit(x[, jj, drop = F], y, wt, start = start, offset =
offset, : linear
> convergence not obtained in 10 iterations.

> Df Deviance AIC
>- vphase1:vstade4 121 303.0781 395.0781
> - sex:vstade4 11 117.2860 429.2860
> - sex:vphase1 11 122.7776 434.7776
> <none> 107.7448 441.7448

>Step: AIC= 395.08
> pmor ~ sex + vphase1 + vstade4 + sex:vphase1 + sex:vstade4

> Df Deviance AIC
>- sex:vstade4 11 312.1739 382.1739
>- sex:vphase1 11 317.5660 387.5660
> <none> 303.0781 395.0781

>Step: AIC= 382.17
> pmor ~ sex + vphase1 + vstade4 + sex:vphase1

> Df Deviance AIC
>- sex:vphase1 11 326.6638 374.6638
> <none> 312.1739 382.1739
> - vstade4 11 517.4243 565.4243

>Step: AIC= 374.66
> pmor ~ sex + vphase1 + vstade4

> Df Deviance AIC
> <none> 326.6638 374.6638
> - sex 1 332.6489 378.6489
>- vphase1 11 389.2429 415.2429
>- vstade4 11 532.4934 558.4934

Matthieu LESNOFF
CIRAD-EMVT (Département Elevage et Medecine Vétérinaire Tropicale)
Programme Productions Animales
Campus de Baillarguet
BP 5035
34032 Montpellier Cedex 1 (France)
email : matthieu.lesnoff@cirad.fr
tel : 04 67 59 37 70
fax : 04 67 59 38 25
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news