Description Usage Arguments Details Value Examples
Calculate the difference in asymmetric trimmed means between Y and X. The percent trimmed from left (α) and right ((β)) are chosen adaptively using grid search. If gridsize = 'sqrtn', the grid of α and β values are spaced by 1/sqrt(n) where n is the size of the smaller group. If gridsize = 'n', the grid values are spaced by 1/n. Note that the two-dimensional grid search is then of size n^2 which can be prohibitively slow for large n, while sqrt(n) will be near optimal and feasible even for large samples. Alternatively, specify any integer of at least 3, up to the size of the smaller group.
1 2 3 4 5 6 7 8 9 | atm_diff(
X,
Y,
gridsize = "sqrtn",
max_alpha = 1,
max_beta = 1,
min_frac = 0.25,
min_obs = 50
)
|
X |
numeric vector, the outcomes of the control observations. |
Y |
numeric vector, the outcomes of the treated observations. |
gridsize |
either the string 'sqrtn' or 'n' or an integer giving the number of alpha and beta values to try |
max_alpha |
numeric between 0 and 1, the maximum fraction of observations to trim from the left (default 1) |
max_beta |
numeric between 0 and 1, the maximum fraction of observations to trim from the right (default 1) |
min_frac |
numeric between 0 and 1, the minimum fraction of observations to KEEP after trimming (default 0.25) |
min_obs |
numeric, the minimum number of observations of each treatment state to KEEP after trimming (default 50) |
The parameters max_alpha and max_beta allow to set bounds for the amount of trimming from the left and right, respectively. Note that the grid spacing is not affected by this; that is, fewer values of α or β need to be searched over when changing the defaults. To only consider trimming of up to the smallest 3 To only trim the right tail of the data, set max_alpha = 0; forcing the function to not trim the left tail may improve stability when appropriate, and should be much faster computationally. The size of the sample after trimming is 1 - α - β where α and β are the selected trimming percentages.
list of four elements:
tau |
the point estimate of the treatment effect |
se |
the estimated standard error (if calc_se = TRUE) |
alpha |
the trimming fraction from the left |
beta |
the trimming fraction from the right |
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.