DD_manu_many: Multi-year diff and diff, manually

View source: R/DiffDiff_manual_byY.R

DD_manu_manyR Documentation

Multi-year diff and diff, manually

Description

This function computes the year-to-year Did. This is useful mainly for visualisation, in particular for the pre-trends (settng lag>1), but has no inference for the DiD effect itself.

Usage

DD_manu_many(
  y_var = "y",
  data,
  time.index = "Time",
  treat = "tr",
  unit.index = "unit",
  lag = 1,
  format_long = TRUE
)

Arguments

y_var

The name of the y variable

data

A data frame containing the variables of interest, 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).

lag

How many lags to look at? Lag=1 will consider 0_1 sequences, lag 2: 0_1_1 etc

format_long

Should it format in long or wide?


MatthieuStigler/multiDiff documentation built on Feb. 14, 2025, 12:02 a.m.