forked from statsmodels/statsmodels
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve stability by normalizing columns Test against Stata
- Loading branch information
Showing
2 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from numpy.testing import assert_almost_equal | ||
|
||
from statsmodels.datasets import statecrime | ||
from statsmodels.regression.linear_model import OLS | ||
from statsmodels.stats.outliers_influence import reset_ramsey | ||
from statsmodels.tools import add_constant | ||
|
||
data = statecrime.load_pandas().data | ||
|
||
|
||
def test_reset_stata(): | ||
mod = OLS(data.violent, add_constant(data[['murder', 'hs_grad']])) | ||
res = mod.fit() | ||
stat = reset_ramsey(res, degree=4) | ||
assert_almost_equal(stat.fvalue[0, 0], 1.52, decimal=2) | ||
assert_almost_equal(stat.pvalue, 0.2221, decimal=4) |