Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t_model: f_test, t_test don't work #80

Closed
josef-pkt opened this issue Oct 4, 2011 · 5 comments
Closed

t_model: f_test, t_test don't work #80

josef-pkt opened this issue Oct 4, 2011 · 5 comments
Milestone

Comments

@josef-pkt
Copy link
Member

after running "scikits\statsmodels\examples\ex_misc_tmodel.py"

>>> resp
<scikits.statsmodels.base.model.GenericLikelihoodModelResults object at 0x05DAC3D0>
>>> resp.t_test(np.eye(len(resp.params)))
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    resp.t_test(np.eye(len(resp.params)))
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef\scikits\statsmodels\base\model.py", line 1024, in t_test
    df_denom=self.model.df_resid)
AttributeError: 'TLinearModel' object has no attribute 'df_resid'
>>> resp.f_test(np.eye(len(resp.params)))
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    resp.f_test(np.eye(len(resp.params)))
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef\scikits\statsmodels\base\model.py", line 1115, in f_test
    return ContrastResults(F=F, df_denom=self.model.df_resid,
AttributeError: 'TLinearModel' object has no attribute 'df_resid'

f_test and t_test are designed for t-distribution and require degrees of freedom

@josef-pkt
Copy link
Member Author

after

resp.model.df_resid = nobs - len(resp.params)

f_test and t-test work

@thomas-haslwanter
Copy link
Contributor

I just checked in "statsmodels\examples" - and no file "ex_misc_tmodel.py" exists. So I guess that this issue is outdated.

@vincentarelbundock
Copy link
Contributor

Confusingly, there are two separate folder that hold similar, partial/unfinished/developer-centered examples. Try this:

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/examples/ex_misc_tmodel.py

@josef-pkt
Copy link
Member Author

Running the example, I don't even get to this stage anymore, the exception/problem is now already earlier raised by patsy with extra parameters, traceback is as in #669

@josef-pkt
Copy link
Member Author

fixed for miscmodels/GenericLikelihoodModels in PR #933

still fails for MNLogit, see #669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants