It seems as though the glm() function in Julia does not always yield the maximum likelihood estimates of parameters when fitting logistic regression models of binomial count data. Moreover, the uncertainties of the parameter estimates can be much higher than those obtained by numerical optimization of the likelihood function or by using the glm() function in R. (see results below)
I have code that provides a reproducible comparison of analyses using Julia’s glm(), Julia’s optimize(), and R’s glm(), but I am unable to upload it here. My results were obtained using Julia version 1.11.6+0.x64.linux.gnu
Is there an alternative way to fit this class of models using Julia’s glm() ?? I assigned the response as the proportion of successes and the wts variable as the total number of successes and failures when using Julia’s glm().
julia> include(“glm_BinomialCounts.jl”)
Analysis using GLM in Julia language
Beta = [-0.48785092134958846, 1.8060232813792254]
se = [0.27280263377390546, 0.34845194964021076]
Analysis using numerical optimization
Beta = [-0.49814787518412995, 1.7812620322369088]
se = [0.07709903822971975, 0.09545673648885034]
Analysis using GLM in R language
Beta = [-0.4981478751358396, 1.7812620318091115]
se = [0.0770985367034779, 0.09545543332580649]