mDid_weights_CH: Weights from Chaisemartin and Hautefeuille

View source: R/mDid_weights_CH.R

mDid_weights_CHR Documentation

Weights from Chaisemartin and Hautefeuille

Description

Weights from Chaisemartin and Hautefeuille

Usage

mDid_weights_CH(
  data,
  y_var = "y",
  time.index = "Time",
  treat = "tr",
  unit.index = "unit",
  return_details = FALSE
)

## S3 method for class 'FE_weights_CH'
print(x, ...)

## S3 method for class 'FE_weights_CH'
plot(x, by = c("time", "unit"), ...)

weights_CH_smry(data)

Arguments

data

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

y_var

The name of the y variable

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).

return_details

Return additional details on weights?

x

Output from mDid_weights_CH

by

Which kind of plot to draw

...

Unused arguments

Value

A enhanced tibble of class FE_weights_CH

w

The weight w_{g,t} as defined in the paper

weight

The weight w multiplied by obs_weight. They sum to 1.

obs_weight

The ratio N_{g,t}/N_1, eventually including also the treatment intensity.

Examples

examp_df <- data.frame(unit = rep(c(1, 2), each=3),
                      time = rep(1:3, 2),
                      treat = c(0, 0, 1, 0, 1, 1))
mDid_weights_CH(examp_df, treat = "treat",
               time.index = "time")

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