xsdid_estimate: A shortcut function to directly perform SDID estimation with...

xsdid_estimateR Documentation

A shortcut function to directly perform SDID estimation with covariates from a panel data set

Description

Calls adjust.outcome.for.y, panel.matrices and then synthdid_estimate. Has similar syntax to xsdid_se_bootstrap.

Usage

xsdid_estimate(
  panel,
  unit = 1,
  time = 2,
  outcome = 3,
  treatment = 4,
  x,
  x.rows = NULL
)

Arguments

panel

A data frame with columns consisting of units, time, outcome, and treatment indicator. It should be a balanced panel and not contain any NA.

unit

The column number/name corresponding to the unit identifier. Default is 1.

time

The column number/name corresponding to the time identifier. Default is 2.

outcome

The column number/name corresponding to the outcome identifier. Default is 3.

treatment

The column number/name corresponding to the treatment status. Default is 4.

x

The column numbers/names of all additional control variables

x.rows

To estimate the effect of x on y, we use by default all rows in which no treatment takes places. The argument x.rows allows to specify these rows manually. E.g. you could only take all rows before the first treatment starts (i.e. compared to the default exclude the rows of the control group during the treatment period).

Value

The resulting object from the call to synthdid_estimate.

Examples

## Not run: 
 dat = xsdid.mc(N=20, T=20,return.data = TRUE)
 xsdid_estimate(dat, unit="i",time = "t",outcome = "y",treatment = "treat_exp",x = "x")
 xsdid_se_bootstrap(dat, unit="i",time = "t",outcome = "y",treatment = "treat_exp",x = "x", B=100)$se

## End(Not run)

skranz/xsynthdid documentation built on May 23, 2022, 8:50 p.m.