From b837ecc3a348cc28caee856a52ae35b0ee5479d9 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 31 Dec 2023 18:34:54 +1100 Subject: [PATCH] Update OrdinalLogit test --- tests/test_ordinallogit.py | 6 +++--- yli/regress.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_ordinallogit.py b/tests/test_ordinallogit.py index 5b4fb83..51c8727 100644 --- a/tests/test_ordinallogit.py +++ b/tests/test_ordinallogit.py @@ -1,5 +1,5 @@ # scipy-yli: Helpful SciPy utilities and recipes -# Copyright © 2022 Lee Yingtong Li (RunasSudo) +# Copyright © 2022–2023 Lee Yingtong Li (RunasSudo) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -44,7 +44,7 @@ def test_ordinallogit_ucla(): expected_summary = ''' Ordinal Logistic Regression Results ========================================================== Dep. Variable: apply | No. Observations: 400 - Model: Ordinal Logit | Df. Model: 5 + Model: Ordinal Logit | Df. Model: 3 Date: {0:%Y-%m-%d} | Df. Residuals: 395 Time: {0:%H:%M:%S} | Pseudo R²: 0.03 Std. Errors: Non-Robust | LL-Model: -358.51 @@ -62,7 +62,7 @@ somewhat likely/very likely 4.30 (2.72 - 5.88) <0.001* ------------------------------------------------------------'''.format(result.fitted_dt) assert result.summary() == expected_summary - assert result._repr_html_() == '
Ordinal Logistic Regression Results
Dep. Variable:applyNo. Observations:400
Model:Ordinal LogitDf. Model:5
Date:{0:%Y-%m-%d}Df. Residuals:395
Time:{0:%H:%M:%S}Pseudo R2:0.03
Std. Errors:Non-RobustLL-Model:-358.51
LL-Null:-370.60
p (LR):<0.001*
β(95% CI)p
pared1.05(0.531.57)<0.001*
public-0.06(-0.640.53)=0.84
gpa0.62(0.101.13)=0.02*
(Cutoffs)
unlikely/somewhat likely2.20(0.683.73)=0.005*
somewhat likely/very likely4.30(2.725.88)<0.001*
'.format(result.fitted_dt) + assert result._repr_html_() == '
Ordinal Logistic Regression Results
Dep. Variable:applyNo. Observations:400
Model:Ordinal LogitDf. Model:3
Date:{0:%Y-%m-%d}Df. Residuals:395
Time:{0:%H:%M:%S}Pseudo R2:0.03
Std. Errors:Non-RobustLL-Model:-358.51
LL-Null:-370.60
p (LR):<0.001*
β(95% CI)p
pared1.05(0.531.57)<0.001*
public-0.06(-0.640.53)=0.84
gpa0.62(0.101.13)=0.02*
(Cutoffs)
unlikely/somewhat likely2.20(0.683.73)=0.005*
somewhat likely/very likely4.30(2.725.88)<0.001*
'.format(result.fitted_dt) def test_brant_ucla(): """Compare RegressionModel.brant with R brant library for UCLA example at https://stats.oarc.ucla.edu/r/dae/ordinal-logistic-regression/""" diff --git a/yli/regress.py b/yli/regress.py index 2e008a4..8f8f352 100644 --- a/yli/regress.py +++ b/yli/regress.py @@ -1063,7 +1063,7 @@ class OrdinalLogit(RegressionModel): Ordinal Logistic Regression Results ========================================================== Dep. Variable: apply | No. Observations: 400 - Model: Ordinal Logit | Df. Model: 5 + Model: Ordinal Logit | Df. Model: 3 Date: 2022-12-02 | Df. Residuals: 395 Time: 21:30:38 | Pseudo R²: 0.03 Std. Errors: Non-Robust | LL-Model: -358.51