Statistical Modelling In Python

Ashita Saxena
Analytics Vidhya
Published in
2 min readJul 8, 2020

Hey Everyone,

As in my last article, i have explained the Time Series Modelling in Python.

Let’s have a look on to the another important modelling in Python i.e, Statistical Modelling.

Statistical Modelling — An Overview

Statistical modelling gives you the ability to asses, understand and make predictions about data.

Statistical modelling is an important part of risk analysis and safety in various engineering areas (mechanical engineering, nuclear engineering), in the management of natural hazards, in quality control, and in finance.

In this Blog, I’ll be Explaining the 2 important topics of Statistical modelling, i.e Linear Regression and ANOVA using Stats model.

SO, LET’S GET STARTED:

1- Linear Regression using Statsmodel →

First of all, taking a dataset :

Now, let’s print the result of the values education and income to obtain the desired output.

2- ANOVA using Statsmodel →

Load the dataset to generate the boxplot:

output:

Performing one way anova:

Let’s have a look on 2-WAY ANOVA:

Plotting the box plot:

Final Output:

Hence, in this way we can use statsmodel to perform statistical modelling in python.

Thank you!!

Keep Learning😊✌

--

--