Glovo/covariate-adjustment-blogpost

Typo in theta calculation

mustaphamodaffar opened this issue · 0 comments

theta = df.cov().loc[prediction_column, "Y"] / df.cov().loc[prediction_column, "Y"]

Currently theta evaluates to 1 since the numerator is identical to the denominator. The denominator should be the variance of the covariate:
df[prediction_column].var()