idd: Identify controls and estimate intervention effects.

Description Usage Arguments Value Examples

View source: R/idd.R

Description

idd takes a long-form panel dataset containing event count and exposure data, obtains the optimal controls and estimates an incidence difference-in-differences model.

Usage

1
2
idd(eventvar, popvar, treatvar, postvar, timevar, idvar, names = NULL,
  print = TRUE, data, mult = 1e+05)

Arguments

eventvar

Name of the event count variable.

popvar

The person-time (or another exposure) variable.

treatvar

The treatment group indicator dummy (0 for controls, 1 for treated units).

postvar

The post-period indicator dummy (0 for all time points in the pre-intervention period, 1 for all time points in the post-period)

timevar

The time variable (can be coded on any scale).

idvar

The panel id variable.

names

A variable containing unit names (optional). Changes the output of id.selected to show unit names of selected controls.

print

Print results? Default=TRUE.

data

A long-form panel dataset containing the supplied variables.

mult

Multiplier for the rates produced by print (default=100000).

Value

Returns a list containing the following elements: $Resdat: a data frame containing the results. $cv_errors: a data frame containing the cross-validation errors for the k-minimizing function. $supp_stats: a data frame containing supplementary statistics (average effects, relative effects, p-values etc). $id_controls: a data frame containing information on the selected controls.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(simpanel)
idd.out <- idd(eventvar="y",
             popvar="pop",
             idvar="age",
             timevar="time",
             postvar="post",
             treatvar="treat",
             data=simpanel)

## End(Not run)

carlbona/idd documentation built on May 19, 2019, 10:48 p.m.