two_by_two_subset: two_by_two_subset

View source: R/subset_functions.R

two_by_two_subsetR Documentation

two_by_two_subset

Description

A function for computing a 2x2 subset of original data. This is the subset with post treatment periods separately for the treated group and comparison group and pre-treatment periods in the period immediately before the treated group became treated.

Usage

two_by_two_subset(
  data,
  g,
  tp,
  control_group = "notyettreated",
  anticipation = 0,
  base_period = "varying",
  ...
)

Arguments

data

the full dataset

g

the current group

tp

the current time period

control_group

whether to use "notyettreated" (default) or "nevertreated"

...

extra arguments to get the subset correct

Value

list that contains correct subset of data, n1 number of observations in this subset, and disidx a vector of the correct ids for this subset.


bcallaway11/pte documentation built on Oct. 20, 2023, 3:21 p.m.