CommencerCommencer gratuitement

Safety precautions needed?

A store is trying to determine if they need to upgrade their safety protocol based on the number of buyers they expect to have on Black Friday 2023, the biggest sales event of the year. Their maximum occupancy limit is 250. Every year on Black Friday, this store surveys each buyer to rate their shopping experience and you happen to get your hands on the data.

The survey dataset, foot_traffic, has been cleaned and loaded for you. It consists of columns: year, visitors, and average_experience_rating.

The statsmodels.api package has been imported as sm, along with matplotlib.pyplot as plt, pandas as pd, and numpy as np.

Cet exercice fait partie du cours

Analyzing Survey Data in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Define variable, x and y
x = foot_traffic.____.____
y = foot_traffic.____.____

# Add the constant term
x = ____.____(x)

# Perform .OLS() regression and fit
result = ____.____(y,x).____()

# Print the summary table
print(____.____())
Modifier et exécuter le code