You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi There!
I am enjoying using your package to analyse ordinal data. However, when I compared the results of mord.LogisticAT(alpha = 0) against from statsmodels.miscmodels.ordinal_model import OrderedModel I obtained different coefficients. Should not they be the same? (As long as I am not using any regularization technique?).
Here is a reproducible example:
import pandas as pd
from statsmodels.miscmodels.ordinal_model import OrderedModel
url = "https://stats.idre.ucla.edu/stat/data/ologit.dta"
data_student = pd.read_stata(url)
X, y = data_student[['pared', 'public', 'gpa']], data_student['apply']
mod_prob = OrderedModel(y,
X,
distr='logit')
res_prob = mod_prob.fit(method='bfgs')
res_prob.summary()
MORD:
import mord
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
y = le.fit_transform(y)
model_mord = mord.LogisticAT(alpha = 50)
model_mord.fit(X, y)
y_pred = model_mord.predict(X)
print('\nCoef mord', model_mord.coef_)
Coef mord [-0.02192845 0.12534365 0.01633311]
which differ a lot from OrderedModel (coefficient of pared is 1.0476 in stasmodel and -0.02192845 in mord).
Also, could I exponentiate the model_mort.coef_ and interpret it as the traditional Odds_Ratio?
Thanks in advance!!
The text was updated successfully, but these errors were encountered:
Hi, I have noticed the same issue recently. I am not sure if I am using an outdated version, but I would like to see this addressed. After extensive testing, it looks like Mord LogitsticAT agrees with MatLab's mnrfit (link here)––at least up to some floating point accuracy. I would be interested in working on a solution or at least a better understanding of the differences between mord, MatLab, and statsmodels.
Hi There!
I am enjoying using your package to analyse ordinal data. However, when I compared the results of
mord.LogisticAT(alpha = 0)
againstfrom statsmodels.miscmodels.ordinal_model import OrderedModel
I obtained different coefficients. Should not they be the same? (As long as I am not using any regularization technique?).Here is a reproducible example:
MORD:
which differ a lot from OrderedModel (coefficient of
pared
is1.0476
in stasmodel and-0.02192845
in mord).Also, could I exponentiate the
model_mort.coef_
and interpret it as the traditionalOdds_Ratio
?Thanks in advance!!
The text was updated successfully, but these errors were encountered: