View source: R/compute_ATE_t.R
compute_ATE_t | R Documentation |
Computes the bounds on the ATE on the dataset, at the period given in input, and using the method specified as entry parameter.
compute_ATE_t(
data,
TEstim,
estimators = env(),
other_numbers = env(),
selectX = NULL,
Option = "quick",
CIOption = "CI2",
alpha = 0.05,
nbCores = 4
)
data |
is an environment variable containing the data. If not already formatted, it will be formatted by the format_data function (see its documentation for information about the stored variables). It must contain at least: - data$Y is a matrix of size n x Tmax containing the values of the dependent variable Y, - data$X is an array of size n x Tmax x dimX containing the values of the covariates X - data$clusterIndexes is a vector of size n x 1 that specifies the cluster each observation pertains to. If it does not exist, the function enforces the default setting of i.i.d. observations - the parameter takes value 1:n so that each observation is its own cluster. |
TEstim |
is a scalar specifying the period at which the effect must be estimated. It can also be a vector of length n if the period at which the ATE must be estimated depends on the individual (e.g. in event-studies models). |
estimators |
(default empty environment) is an environment in which the results of the CMLE estimation and of the non-parametric estimation of the conditional distribution of S will be stored. That way, if an input is specified, these numbers will not need to be computed again if compute_AME_t is called another time, as the same environment can be passed in input again. Results are stored as follows: - estimators$beta_hat, a list which contains the results from CMLE estimation: - estimators$beta_hat$beta_hat a vector of length dimX, the estimated value for the slope parameter. - estimators_beta_hat$phi_b a matrix of size n x dimX containing the value of the influence function at each observation (rows) w.r.t. each dimension of the covariates (columns). - estimators$beta_hat$var_b the estimated asymptotic covariance matrix, of size dimX x dimX, for the estimator beta_hat. - estimators$h_local_lin_proba a vector of length (Tmax + 1) containing, in j-th position, the bandwidth used to estimate the P(S = j - 1 | X)'s. - estimators$condlProbas: a matrix of size n x (Tmax + 1) containing, in position (i, j), the estimate for P(S = j - 1 | X) at the i-th observation. - estimators$densityEstimate a matrix of size n x (Tmax + 1) containing, at each row (individual), the estimated density for having covariates (X_1, ..., X_T). Each column represents the value found using the corresponding bandwidths from h. |
other_numbers |
(default empty environment) is an environment variable in which the variable other_numbers$comb_numbers is stored. A matrix of size (Tmax + 1) x (Tmax + 1) containg in position (i, j) the number (i choose j). If j > i the value is NA. |
selectX |
(default NULL) a vector containing the indices of the covariates w.r.t. which the ATE must be computed. If null, the ATE w.r.t. all covariates will be computed. All variables of interest should be given in the same call, as then there will be no additional cost relative to estimating w.r.t. only one covariate. |
Option |
(default "quick") Estimation method to be used. If "quick" or "outer" (case-insensitive) the outer bounds are computed. Otherwise, the sharp bounds are computed. We recommend using the outer bounds method if the number of covariates is at least three, if the number of periods observed is four or more, or if the sample size is small (less than 500) or large (more than 10^4). |
CIOption |
(default "CI2") When the outer bounds method is being used, specifies which confidence interval should be used. If "CI2", the CI2 confidence interval is being used (see DDL, section 4.2), otherwise the CI3 confidence interval will be used (see DDL, appendix C). |
alpha |
(default 0.05) desired asymptotic level of the estimated confidence intervals |
nbCores |
(default 4) number of cores to be used for parallel computing, to speed up the estimation of the sharp bounds. |
a list containing: - Option: same as input - reducedSampleSize: the number of individuals used to estimate the ATE. The individuals that were not observed at the period for which the ATE should be computed were excluded. - computationTime: the time (in seconds) taken to perform the computation - estimatedAMEbounds: a matrix of size |selectX| x 2 containing the estimated (sharp or outer, depending on Option) bounds on the ATE, for each covariate in selectX. - CI: a matrix of size |selectX| x 2 containing in each row the estimated confidence interval for the ATE, for the corresponding covariate in selectX. - alt_CI: a matrix of size |selectX| x 2 containing in each row the estimated confidence interval for the AME, for the corresponding covariate in selectX, using the confidence interval option NOT requested by the user, for the outer bounds. If the sharp bounds were being computed, this output is NA. - indl_estimates: a list containing the bounds and influence functions for individual observations. They will be used to estimate the average ATE over all periods. They are organised as follows: - indl_estimates$indl_bounds_on_delta is a matrix of size n x 2 x dimX containing the estimated lower and upper bounds on the ATE, for each individual observation. It is NA for the individuals unobserved at the requested period. - indl_estimates$indl_infl_func_delta is a matrix of size n x 2 x dimX containing the estimated value of the influence function for the lower and upper bounds on the ATE, for each individual observation. It is NA for the individuals unobserved at the requested period.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.