Skip to contents

[Stable]

Link dates to GeoLift time periods.

Usage

get_date_from_test_periods(
  GeoLift,
  treatment_end_date,
  post_treatment_periods = 0,
  frequency = "daily"
)

Arguments

GeoLift

GeoLift object.

treatment_end_date

Character that represents a date in year-month=day format.

post_treatment_periods

Number of post-treatment periods. Zero by default.

frequency

Character that represents periodicity of time stamps. Can be either weekly or daily. Defaults to daily.

Value

List that contains:

"date_vector":

Vector of dates, going from first pre test time to end of test.

"treatment_start":

start date of study.

"treatment_end":

End date of study.

Examples

# \donttest{
geo_test <- GeoDataRead(GeoLift_Test, date_id = "date", location_id = "location",
  Y_id = "Y", format = "yyyy-mm-dd")
lift <- GeoLift(Y_id = "Y", data = geo_test, locations = c("chicago", "portland"),
  treatment_start_time = 91, treatment_end_time = 105)
dates <- get_date_from_test_periods(lift, treatment_end_date = "2021-04-15")
dates$treatment_start
#> [1] "2021-04-01"
# }