DD: Compute the diff-and-diff by period. \lifecycleexperimental

View source: R/DiffDiff_byY.R

DDR Documentation

Compute the diff-and-diff by period. \lifecycleexperimental

Description

Compute the diff-and-diff by period. \lifecycleexperimental

Usage

DD(
  y_var = "y",
  data,
  time.index = "Time",
  treat = "tr",
  unit.index = "unit",
  min_obs_required = 2,
  treatment = c("binary", "categorical")
)

Arguments

y_var

The name of the y variable

data

A data frame containing the variables of itnerest, should have names y_var, treat, time.index and unit.index

time.index

The name of the variable describing the time index (date, year, etc)

treat

The name of the treatment variable.

unit.index

The name of the units (individual, county, household, etc).

min_obs_required

the minimum number of either treat or control needed to run a regresion

treatment

Is treatment binary or categorical?

See Also

DiD_aggreg for aggregating the output of DD over years.

Examples

data <- sim_dat(N=100)
DD_out <- DD(data=data)
DiD_aggreg(x=DD_out, by_DiD = FALSE)
DiD_aggreg(x=DD_out, by_DiD = TRUE)

MatthieuStigler/multiDiff documentation built on Oct. 21, 2023, 8:13 a.m.