Get startedGet started for free

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.

This exercise is part of the course

Analyzing Survey Data in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample 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(____.____())
Edit and Run Code