Page 1 of 1

stepAIC function in MASS pkg vs jamovi: different results

Posted: Sun Jun 21, 2020 10:30 am
by j0hn
I used the stepAIC function in the package MASS to do binomial logistic regression on a dataset and the final model derived had an AIC of 57.8. When I tried to replicate the model in jamovi, the AIC was 131. Why the different results? jamovi results attached. Thanks

MASS pkg results:
Call:
glm(formula = phototherapy ~ compatibility + DAT_results + peak_bili,
family = binomial, data = szAIC)

Deviance Residuals:
Min 1Q Median 3Q Max
-1.80278 -0.28119 -0.16732 -0.07112 2.52543

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -8.1175 1.8056 -4.496 6.93e-06 ***
compatibility -1.7169 1.0480 -1.638 0.1014
DAT_results 1.9487 0.9220 2.114 0.0345 *
peak_bili 0.6969 0.1646 4.235 2.29e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 94.419 on 135 degrees of freedom
Residual deviance: 49.809 on 132 degrees of freedom
AIC: 57.809

Number of Fisher Scoring iterations: 7

Re: stepAIC function in MASS pkg vs jamovi: different result

Posted: Sun Jun 21, 2020 10:37 am
by jonathon
not sure,

but the models in jamovi are constructed like this:

https://github.com/jamovi/jmv/blob/master/R/logregbin.b.R#L72

and then the AIC is calculated like this:

https://github.com/jamovi/jmv/blob/master/R/logregbin.b.R#L79

the folks responsible for writing the underlying packages may be better equipped to handle questions of why results the differ.

cheers