# Chow-Style Group Difference Tests
# Module 7 - Full Regression Differences Across Groups
# Dataset: MODULE7_WAGE_GROUPS_SYNTHETIC

# Chow-Style Group Difference Tests
#
# Module 7 notebook lab. This notebook uses an original Ceteris Lab synthetic teaching dataset and does not report real empirical findings.

# Learning goal
# Use interaction restrictions to test full group differences.
#
# Dataset: MODULE7_WAGE_GROUPS_SYNTHETIC. Variables: hourly_wage, female, education, experience.

# %% Cell 3
import pandas as pd
import statsmodels.api as sm

df = pd.read_csv("/data/module-7/module7_wage_groups_synthetic.csv")
df["female_educ"] = df["female"] * df["education"]
df["female_exper"] = df["female"] * df["experience"]
model = sm.OLS(df["hourly_wage"], sm.add_constant(df[["female", "education", "experience", "female_educ", "female_exper"]])).fit()
print(model.f_test("female = 0, female_educ = 0, female_exper = 0"))

# Reflection
# Write two sentences: one coefficient, group difference, or predicted-probability interpretation, and one limitation or coding choice that matters.
