- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Data
Test a Business Question with Statistical Hypothesis Testing
You'll work through a real marketing analytics question: whether a redesigned email campaign produced a statistically significant change in click-through rate compared to the original. By the end of the lab, you'll know how to translate a business question into testable hypotheses, run the appropriate test in Python, and explain what the results mean for decision-making.
Lab Info
Table of Contents
-
Challenge
Step 1: Explore the dataset and frame the business question
The lab's codebase lives in the
applicationdirectory. You'll extend Python modules there to analyze an email campaign A/B test and help a marketing team decide whether a redesigned email produced a meaningful change in click-through rate.In this lab, you'll build a small Python analysis pipeline that loads campaign data, states testable hypotheses, runs a two-proportion z-test, interprets the p-value, and reports a confidence interval plus a stakeholder summary. The
applicationdirectory already contains a campaign CSV, module stubs with TODO markers, and amain.pyscript that runs the full analysis once your functions are in place. To begin, you'll load the dataset and translate the product manager's question into code.Feeling stuck? Check out the matching
solution/stepN/folder for the step you're on to see a working implementation. Give it a try on your own first. The solution folder is your safety net, not your starting point. info> This lab experience was developed by the Pluralsight team using an internally developed AI tool. All sections were verified by human experts for accuracy prior to publications. However, content may still contain errors or inaccuracies, and we recommend independent verification.
To report a problem or provide feedback, click here. Feedback may be used to improve accuracy in accordance with our Privacy Policy. -
Challenge
Step 2: Formulate null and alternative hypotheses
Campaign data is loaded and click-through rates are computed for each variant. That baseline makes it possible to state formal hypotheses about whether the observed difference is real or due to chance. Here, you'll translate the business question into null and alternative hypotheses and identify the parameter under test.
By the end of this step, H₀, H₁, and the parameter of interest will be defined as code constants ready for the statistical test.
-
Challenge
Step 3: Select and execute the statistical test
The hypotheses and parameter of interest are defined. The next move is to choose an appropriate two-proportion test and run it against the campaign data using Python's standard library.
By the end of this step, the test statistic and p-value will be computed and stored for interpretation.
-
Challenge
Step 4: Interpret the p-value and make a decision
The proportion test has produced a test statistic and p-value. Those numbers need context: compare the p-value to a significance level, decide whether to reject H₀, and state what that decision means for the campaign.
By the end of this step, a significance decision and contextual explanation will be captured in code.
-
Challenge
Step 5: Compute a confidence interval and summarize findings
The hypothesis test decision is in place. A confidence interval for the difference in click-through rates adds practical context, and a stakeholder summary ties the numbers back to the business question.
By the end of this step, a confidence interval and plain-language summary will be ready to share with leadership.
-
Challenge
Lab Complete
Congratulations on completing this lab.
You built a Python workflow that turns a marketing A/B test question into formal hypotheses, a two-proportion test, and a decision backed by a p-value and confidence interval. Running
main.pyshowed the full analysis end to end, from loaded campaign data through a stakeholder-ready summary.You practiced skills that transfer to other business questions: framing testable hypotheses, selecting an appropriate test for proportion data, interpreting statistical significance in context, and communicating limits of what the data supports. These steps form the core of evidence-based decision making with hypothesis testing in Python.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.