fn_treatment: Auxiliary function to generate the treatment variable D.

View source: R/auxiliary.R

fn_treatmentR Documentation

Auxiliary function to generate the treatment variable D.

Description

[Stable]

fn_treatment generates the treatment variable D, where D = 1 for test locations in the test period and D = 0 otherwise.

Usage

fn_treatment(df, locations, treatment_start_time, treatment_end_time)

Arguments

df

A data.frame containing the historical conversions by geographic unit. It requires a "locations" column with the geo name, a "Y" column with the outcome data (units), a time column with the indicator of the time period (starting at 1), and covariates.

locations

List of names of the test locations (String).

treatment_start_time

Time index of the start of the treatment.

treatment_end_time

Time index of the end of the treatment.

Value

Data frame with the additional treatment variable (D).


facebookincubator/GeoLift documentation built on May 31, 2024, 10:09 a.m.