View source: R/sensitivityresults.R View source: R/HonestDiD-Temp.R
createSensitivityResults | R Documentation |
\Delta = \Delta^{SD}(M)
, \Delta^{SDB}(M)
and \Delta^{SDM}(M)
for vector of possible M values.
Constructs robust confidence intervals for a choice \Delta = \Delta^{SD}(M)
, \Delta^{SDB}(M)
and \Delta^{SDM}(M)
for vector of possible M values. By default, the function constructs robust confidence intervals for \Delta^{SD}(M)
.
createSensitivityResults(betahat, sigma,
numPrePeriods, numPostPeriods,
method = NULL,
Mvec = NULL,
l_vec = .basisVector(index = 1, size = numPostPeriods),
monotonicityDirection = NULL,
biasDirection = NULL,
alpha = 0.05,
parallel = FALSE,
seed = 0)
betahat |
Vector of estimated event study coefficients. |
sigma |
Covariance matrix of event study coefficients. |
numPrePeriods |
Number of pre-periods. |
numPostPeriods |
Number of post-periods. |
method |
String that specifies the choice of method for constructing robust confidence intervals. This must be one of "FLCI", "Conditional", "C-F" (conditional FLCI hybrid), or "C-LF" (conditional least-favorable hybrid). Default equals NULL and the function automatically sets method based on the recommendations in Rambachan & Roth (2021) depending on the choice of Delta. If Delta = DeltaSD, default selects the FLCI. If Delta = DeltaSDB or DeltaSDM, default delects the conditional FLCI hybrid. |
Mvec |
Vector of M values for which the user wishes to construct robust confidence intervals. If NULL, the function constructs a grid of length 10 that starts at M = 0 and ends at M equal to the upper bound constructed from the pre-periods using the function DeltaSD_upperBound_Mpre if number of pre-periods > 1 or the standard deviation of the first pre-period coefficient if number of pre-periods = 1. Default equals null. |
l_vec |
Vector of length numPostPeriods that describes the scalar parameter of interest, theta = l_vec'tau. Default equals to first basis vector, (1, 0, ..., 0) |
biasDirection |
This must be specified if the user wishes to add an additional bias restriction to |
monotonicityDirection |
This must be specified if the user wishes to add an additional monotonicity restriction to |
alpha |
Desired size of the robust confidence sets. Default equals 0.05 (corresponding to 95% confidence interval) |
parallel |
Logical to indicate whether the user would like to construct the robust confidence intervals in parallel. This uses the Foreach package and doParallel package. Default equals FALSE. |
seed |
Random seed for internal computations; included for reproducibility. |
Returns a dataframe with columns
lb |
Lower bound of robust confidence sets. |
ub |
Upper bound of robust confidence sets. |
method |
Method for constructing robust confidence sets |
Delta |
The set Delta that was specified. |
M |
Values of M associated with each robust confidence set. |
Ashesh Rambachan
Rambachan, Ashesh and Jonathan Roth. "An Honest Approach to Parallel Trends." 2021.
# Simple use case; for more detailed examples,
# see <https://github.com/asheshrambachan/HonestDiD#honestdid>
createSensitivityResults(betahat = BCdata_EventStudy$betahat,
sigma = BCdata_EventStudy$sigma,
numPrePeriods = length(BCdata_EventStudy$prePeriodIndices),
numPostPeriods = length(BCdata_EventStudy$postPeriodIndices),
alpha = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.