Performing GLM within python script on windows 7 64
I'm trying to perform GLM (Generalized linear model) repeatedly within a python script (within a loop).
1- I tried to use Stats within Scipy glm function but description is quite inexistant and I think I did not use it well --> error message
"ValueError: only ttest_ind implemented".
I searched within stats.py file and in _support.py to find my way without results.
2- I have tried to install RPY2 (hope that lgautier or other will read me) ot use开发者_StackOverflow社区 R powered functions. But I'm on windows 7 64, and it seems that I did not succeed to install it well. I have error message:
import rpy2.tests
File "C:\Python26\lib\site-packages\rpy2\tests.py", line 3, in
import rpy2.robjects.tests
File "C:\Python26\lib\site-packages\rpy2\robjects\__init__.py", line 12, in
import rpy2.rinterface as rinterface
File "C:\Python26\lib\site-packages\rpy2\rinterface\__init__.py", line 22, in
"This might be because R.exe is nowhere in your Path.")
RuntimeError: Unable to determine R version from the registery.Calling the command 'R RHOME' does not return anything.
This might be because R.exe is nowhere in your Path.
How to perform robust GLM in python (other ways?, I tried good ones but I missed ...?)? How to install RPY (noob/basic student learner) on windows 7 64 and interface it with python?
I don't know why the answers here seem to indicate that statsmodels test coverage for GLM is not that good. I wrote the tests. The models are verified against Stata, R, and SAS. They're pretty comprehensive. If you find something unexpected or this not to be the case then please report it to developers.
https://github.com/statsmodels/statsmodels/blob/master/scikits/statsmodels/genmod/tests/test_glm.py
And shortly after my last comment, I find this:
http://statsmodels.sourceforge.net/
with its GLM documentation here:
http://statsmodels.sourceforge.net/glm.html
I'd strongly suggest cross-checking with R's fit as well to make sure it's doing what you think.
I answer at me:
statsmodels are not developed and tested enough to be employed, so DO NOT USE STATSMODELS in its current version to perform GLM --> rpy2 is appropriate but need some complicated install (copy into /Pythonxx/Lib/site-packages/ folders extracted from rpy2 tar and get 'nose' and copy it at the same place)
精彩评论