The output of linear regression can be summarized in a regression table.
The table includes:

Here’s how to generate a linear regression table in Python:
| import pandas as pd import statsmodels.formula.api as smf full_health_data = pd.read_csv(“data.csv”, header=0, sep=“,”) model = smf.ols(‘Calorie_Burnage ~ Average_Pulse’, data = full_health_data) results = model.fit() print(results.summary()) |
Example Explained:
statsmodels.formula.api as smf, which is a statistical library in Python.full_health_data dataset.smf.ols(). Note that the explanatory variable should be listed first in the parentheses. Use the full_health_data dataset..fit() to obtain the variable results, which contains detailed information about the regression model.summary() to generate the table displaying the results of the linear regression.