Interpreting Linear Regression Through statsmodels .summary()
<p>The earlier line of code we’re missing here is <code><strong>import </strong>statsmodels.formula.api <strong>as </strong>smf</code> So what we’re doing here is using the supplied ols() or Ordinary Least Squares function from the statsmodels library. OLS is a common technique used in analyzing linear regression. In brief, it compares the difference between individual points in your data set and the predicted best fit line to measure the amount of error produced. The smf.ols() function requires two inputs, the formula for producing the best fit line, and the dataset.</p>
<p>The formula is provided as a string, in the following form: ‘dependent variable ~ list of independent variables separated by the + symbol’ In plain terms, the dependent variable is the factor you are trying to predict, and on the other side of the formula are the variables you are using to predict. The data set in this case is named ‘df’ and is being used to determine per capita wager in the Royal Lottery of 1830’s France using a few characteristics. For the purpose of this lesson, the data is irrelevant but is available</p>
<p><a href="https://medium.com/swlh/interpreting-linear-regression-through-statsmodels-summary-4796d359035a"><strong>Website</strong></a></p>