stepAIC function in MASS pkg vs jamovi: different results

Discuss statistics related things

by j0hn » Sun Jun 21, 2020 10:30 am

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
Attachments
2020-06-21 at 13.34.44 stepAIC.png
2020-06-21 at 13.34.44 stepAIC.png (84.09 KiB) Viewed 513 times
j0hn
 
Posts: 12
Joined: Tue Jul 23, 2019 3:20 am
Location: Chiang Mai, Thailand

by jonathon » Sun Jun 21, 2020 10:37 am

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
User avatar
jonathon
 
Posts: 1473
Joined: Fri Jan 27, 2017 10:04 am


Return to Statistics

cron