# Binary Variables
# Module 7 - Creating Binary Variables
# Dataset: MODULE7_STUDENT_COMPLETION_SYNTHETIC

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

# Learning goal
# Create and audit binary indicators from transparent rules.
#
# Dataset: MODULE7_STUDENT_COMPLETION_SYNTHETIC. Variables: completed_module, study_hours, learning_format, mobile_user.

# %% Cell 3
import pandas as pd
import numpy as np

df = pd.read_csv("/data/module-7/module7_student_completion_synthetic.csv")
df["high_study"] = np.where(df["study_hours"] >= 8, 1, 0)
df["online"] = (df["learning_format"] == "online").astype(int)
print(df[["study_hours", "high_study", "learning_format", "online"]].head())

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