Skip to contents

Data generating function

Usage

datageneration(n, tau, continuous = TRUE)

Arguments

n

The number of cross-sectional units

tau

The length of time series such that tau > 2

continuous

Boolean for whether or not to consider a continuous covariate. If it is TRUE (resp. FALSE), a continuous (resp. discrete) covariate is generated. Default is TRUE.

Value

A data.frame that contains the following elements.

id

The unit index

period

The time period index

Y

The outcome

G

The group

Z

The scalar continuous covariate

Examples

set.seed(1)
data <- datageneration(n = 1000, tau = 4, continuous = TRUE)