From the course: Practical Python for Time Series Analysis

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Run regression with categorical predictors

Run regression with categorical predictors - Python Tutorial

From the course: Practical Python for Time Series Analysis

Run regression with categorical predictors

- [Instructor] We've got the chart in the fig variable of each individual category, and, now, we'd like to access the results for the R-squared, also, the coefficients and the test. To reach these tables, we must use a function from Plotly library. We've got the information for each one of the linear regression based on the categories in the variable fig. However, we see the numbers to interpret them, the R-squared, the coefficients, interactively in the chart, but if we'd like to access more of these metrics individually and get more information about the model, such as the P-value, the confidence interval, we shall develop some specific steps using the Plotly library. To do so, first, we will access the information with the function get_trendline_results that is asking for the figure inside the parenthesis. We pass it, and then we get the results. Let's save it into the variable R, and, now, to access them, we can go…

Contents