Interpreting Linear Regression Through statsmodels .summary()

<p>The earlier line of code we&rsquo;re missing here is&nbsp;<code><strong>import&nbsp;</strong>statsmodels.formula.api&nbsp;<strong>as&nbsp;</strong>smf</code>&nbsp;So what we&rsquo;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: &lsquo;dependent variable ~ list of independent variables separated by the + symbol&rsquo; 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 &lsquo;df&rsquo; and is being used to determine per capita wager in the Royal Lottery of 1830&rsquo;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>