Semester Project – Part 2: Statistical Inference &
Linear Regression
In Part 2 of the semester project, you will use statistical hypothesis testing and
regression analysis to formally test the relationships you proposed in Part 1.
You must continue using the same dataset and the same research topic from Part 1.
Please keep working in the same teams as in Part 1.
If working in pairs, submit one shared submission with both students’ names and Znumbers at the top.
Use of AI tools (ChatGPT, Copilot, Gemini, etc.) is not allowed for any part of this
project. Projects that were generated by AI will receive 0 points, will result in
potential F in the course, and will be reported for academic dishonesty.
Stating hypotheses
Based on your Part 1 proposal and the feedback from the TA/instructor, you must now
state formal statistical hypotheses. After your names and Z-numbers on top of your
Jupyter notebook, add a Markdown cell and state 6 hypotheses (each having H0 and
H1) you will test with the corresponding statistical tests.
You must include:
A. Two hypotheses for a t-test (2 points)
These must involve:
One binary categorical variable (e.g., smoker vs non-smoker, male vs female)
One numerical variable
Example:
H₀ : There is no difference in average blood pressure between smokers and nonsmokers.
H₁ : There is a difference in average blood pressure between smokers and nonsmokers.
B. Two hypotheses for a chi-square test (2 points)
These must involve two categorical variables.
Example:
H₀ : Gender and depression status are independent.
H₁ : Gender and depression status are associated.
C. Two hypotheses for linear regression (2 points)
Each must involve:
One numerical outcome variable
One main independent variable
Please state what control variables will be in this model (including at least two).
Example:
H₀ : Income is not associated with years of education.
H₁ : Income is positively associated with years of education.
Hypotheses Testing
Two t-tests (3 points for 2 tests = 6 points)
For each of your two t-test hypotheses, you must:
Check whether the numerical variables follow normal distribution (you can plot a
histogram for this). Add a markdown cell and state your observation regarding
the distribution and whether a t-test is an appropriate test considering the
distribution. (1 point)
Perform the t-test (1 point)
Add a markdown cell and discuss the obtained p-values (1 point). State your
findings in terms of null and alternative hypotheses. Example:
There is not enough evidence that there is a difference in average blood
pressure between smokers and non-smokers (p > 0.05), failing to reject
H0.
Two Chi-Square Tests (3 points for 2 tests = 6 points)
For each of your two chi-square hypotheses, you must:
Create a contingency table (1 point)
Perform a chi-square test of independence (1 point)
Interpret the results considering the p-value and in terms of H0 and H1 (like
stated above) (1 point).
Two Linear Regression Models (6x2 = 12 points)
You must fit at least two linear regression models.
For each model:
Clearly state (1 point):
Dependent variable based on your hypothesis.
The main independent variable based on your hypothesis.
Control variables (pick at least two control variables)
Create a scatterplot by using the dependent and the independent variable (1
point)
Add a markdown cell and state what you observe from the scatterplot (do you
think the relationship is positive or negative?) (1 point)
Fit the model by also incorporating the stated control variables (1 point)
After each linear regression, add a Markdown cell where you will report your
findings. Focus on the direction and significance of the relationship in context of
your H0 and H1 (1 point). Specifically, include:
The coefficients: What is the effect of the independent variable on the
dependent variable? What is the effect of the control variables on the
dependent variable?
The p-values: What do they indicate about the significance of the
relationship?
In a separate Markdown cell, discuss the R^2 value from your linear regression
analysis. Explain what this value tells you about the model's fit and how well the
independent variables explain the variation in the dependent variable. (1 point)
You must build two distinct linear regression models using different
variables. Simply changing the order of the variables does not count as a
different model and will result in point deductions. If your dataset does not
contain another continuous variable that can serve as the dependent
variable, use a different set of independent and control variables for the
second model.
Note About Interpretations
Your interpretations should be meaningful and analytical rather than simply restating
statistical output or providing generic textbook definitions. For example, statements
such as "the coefficient is 0.45," "the p-value is 0.03," or "the R² is 0.62" without further
explanation are not sufficient. Similarly, generic interpretations such as "because p <
0.05, we reject the null hypothesis" or "because p > 0.05, we fail to reject the null
hypothesis" will receive limited credit.
Instead, explain what the results mean in the context of your variables and research
questions. For example:
Weak interpretation: "The coefficient for study hours is 2.5 and the p-value is 0.01."
Strong interpretation: "For each additional hour spent studying, exam scores increase
by an average of 2.5 points, holding other variables constant. The relationship is
statistically significant, suggesting that study time is an important predictor of exam
performance."
Weak interpretation: "The R² is 0.60."
Strong interpretation: "The model explains 60% of the variation in exam scores,
indicating that the selected predictors account for a substantial portion of differences in
student performance."
Focus on the practical meaning of the results, not just the numerical values obtained by
the Python code.
Submission Requirements
Please submit the Jupyter Notebook in .html format. The code should not have any
errors and should include all the outputs/markdown cells. Make sure to include names
and Z-numbers at the top. No separate report is needed — everything should be in the
notebook.
Note: You must submit your code in .html format. If not, 2 points will be deducted.
Your name and Z-number must appear at the top of every document. If they are
missing from one document, 2 points will be deducted; if they are missing from
both, 4 points will be deducted. Include your name and Z-number even if you are
working alone.
Grading Rubric
Project aspect
Stating Hypotheses
Two t-tests
Two Chi-square tests
Two linear regression models
Total
Total points (30)
6
6
6
12
30