Skip to contents

The `datageneration()` function generates artificial balanced panel data from the data generating process considered in the Monte Carlo experiment in Yanagi (2023).

Usage

datageneration(N, S)

Arguments

N

The number of cross-sectional units

S

The length of time series

Value

A data.frame that contains the following elements.

id

The unit index

period

The time period index

Y

The outcome

D

The treatment

X

The unit-specific covariate

once

Whether some treatment realization has been received at least once so far

event

The earliest time period of receiving some treatment realization so far (the event date)

number

The number of treatment adoptions so far

References

Yanagi, T., 2023. An effective treatment approach to difference-in-differences with general treatment patterns. arXiv:2212.13226.

Examples

set.seed(1)
data <- datageneration(N = 1000, S = 4)