Implementing the Model Specification

The following can be used to implement the model specification in R:

Cumulative model:

daily_usage ~ treatment + mm*(avg_preusage + avg_preusage_summer + avg_preusage_winter)

Monthly model:

daily_usage ~ treatment:mm + mm*(avg_preusage + avg_preusage_summer + avg_preusage_winter)

The following can be used to implement the model specification as a Stata command:

Cumulative model:

reg daily_usage treatment i.mm##c.avg_preusage ///
             i.mm##c.avg_preusage_summer ///
             i.mm##c.avg_preusage_winter ///
             [pw = bill_duration_days] ///
             if post == 1 & trimmed == 0 ///
             , vce(cluster opower_customer_id)

Monthly model:

reg daily_usage c.treatment#i.mm i.mm##c.avg_preusage ///
             i.mm##c.avg_preusage_summer ///
             i.mm##c.avg_preusage_winter ///
             [pw = bill_duration_days] ///
             if post == 1 & trimmed == 0 ///
             , vce(cluster opower_customer_id)