setup_pte_basic | R Documentation |
This is a lightweight (example) function for how to setup
the data to be used in the pte
package.
setup_pte_basic
takes in information about the structure of data
and returns a pte_params
object. The key piece of information
that is computed by this function is the list of groups and list of
time periods where ATT(g,t) should be computed. In particular, this function
omits the never-treated group but includes all other groups and drops the first
time period. This setup is basically geared towards the 2x2 case —
i.e., where ATT could be identified with two periods, a treated and
untreated group, and the first period being pre-treatment for both groups.
This is the relevant case for DID, but is also relevant for other cases as well.
However, for example, if more pre-treatment periods were needed, then this
function should be replaced by something else.
For code that is written with the idea of being easy-to-use by other researchers, this is a good place to do some error handling / checking that the data is in the correct format, etc.
setup_pte_basic(
yname,
gname,
tname,
idname,
data,
cband = TRUE,
alp = 0.05,
boot_type = "multiplier",
gt_type = "att",
ret_quantile = 0.5,
biters = 100,
cl = 1,
...
)
yname |
Name of outcome in |
gname |
Name of group in |
tname |
Name of time period in |
idname |
Name of id in |
data |
balanced panel data |
alp |
significance level; default is 0.05 |
boot_type |
which type of bootstrap to use |
gt_type |
which type of group-time effects are computed. For backward compatiblity, the default choice is "att" |
biters |
number of bootstrap iterations; default is 100 |
cl |
number of clusters to be used when bootstrapping; default is 1 |
pte_params
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.