Thomas
Thomas

Reputation: 491

How do I find the sum of squares of my predicting variables with statsmodels linear model OLS?

I have a relatively small dataset consisting of x, y coordinates and organic matter content. I perform a simple multi-linear regression in Python using statsmodels.api ordinary least square (OLS) with organic matter content being the dependent variable and the others predictors. Firstly, I find the total sum of squares of my model (called mreg) with the built-in method 'mreg.centered_tss'. Now I have to find the sum of squares for my predictors, the x and y variable. Is it possible to do with the statsmodels.api or should I use a for loop instead?

I have used the .ess and the .centered_tss to determine the sum of squares of the model. I only need to know the sum of squares of my modelled variables x and y coordinates compared to the mean.

edit: I think what I am asking for is the residual sum of squares of my x coordinates and y coordinates from the model.

Thomas

Upvotes: 1

Views: 2492

Answers (1)

gyoza419
gyoza419

Reputation: 36

there should be a .ssr method for the regression sum of squares

Upvotes: 2

Related Questions