0

I'm new to using statsmodel and Python for analysis.

I run a model and get a respectable .738 for an R-Squared all my coofeicents look good.

Since I ant to be able actually generate a prediction based on the coeffeicents I add a constant to get the intercept into the model with:

from statsmodels.api import add_constant
X = add_constant(X)

Now my R-Squared goes south. Something like .11. Question is am I doing the right thing to add the intercept and if so does that mean my model is crap?

Chris The DBA
  • 105
  • 1
  • 9
  • The definition of rsquared changes, see previous answers starting at http://stackoverflow.com/questions/29664471/why-would-r-squared-decrease-when-i-add-an-exogenous-variable-in-ols-using-pytho/29665662#29665662 – Josef Dec 01 '16 at 15:05
  • you need to add the intercept in general. Whether an rsquared of 0.11 is bad or the best you can do depends on the context. E.g. the best model and prediction of the mean for pure noise is a constant. – Josef Dec 01 '16 at 15:09
  • Thanks. Makes sense. – Chris The DBA Dec 01 '16 at 15:43

0 Answers0