# Dummy Interactions
# Module 7 - Binary by Binary Interactions
# Dataset: MODULE7_WAGE_GROUPS_SYNTHETIC

# Dummy Interactions
#
# Module 7 notebook lab. This notebook uses an original Ceteris Lab synthetic teaching dataset and does not report real empirical findings.

# Learning goal
# Interpret binary-by-binary interactions as conditional group differences.
#
# Dataset: MODULE7_WAGE_GROUPS_SYNTHETIC. Variables: hourly_wage, female, married, education.

# %% 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_married"] = df["female"] * df["married"]
model = sm.OLS(df["hourly_wage"], sm.add_constant(df[["female", "married", "female_married", "education"]])).fit()
print(model.params.round(3))
print(df.groupby(["female", "married"])["hourly_wage"].mean().round(2))

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