Is it possible in python/scipy/numpy to zero the intercept of a multivariate regression? I couldn’t find it in the OLS recipe (http://www.scipy.org/Cookbook/OLS).
I’d prefer not to have to use RPython but is that the only way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
http://statsmodels.sourceforge.net/stable/generated/statsmodels.regression.linear_model.OLS.html
statsmodels requires you to create your designmatrix, called exog, that does not automatically add a constant/intercept. So, using statsmodels you can just leave out the constant and run your regression.
Some test or result statistic might not be correct in this case, since they assume that a constant is included, for example r_squared, if I remember correctly.