Description Usage Arguments Details Value References Examples
This routine computes nonparametric confidence limits for bootstrap estimates.
1 2 3 |
df |
a dataframe with n rows, assumed to be independently sampled from the target population. |
B |
number of bootstrap replications |
est |
function of the estimating equation, \hat{θ} = est(x), which returns a real value for the parameter of interest |
... |
additional arguments for est |
jcount |
value used in calculating a. Because n can get very large, calculating n jackknife values can be slow. A way to speed up the calculation is to collect the n observations into jcount groups and deleting each group in turn. Thus we only evaluate jcount calculations instead of n. |
jreps |
number of repetitions of grouped jackknives. These jreps calculations are averaged to obtain our \hat{a}. |
iereps |
a separate jackknife calculation estimates the internal standard error. The B-length vector theta^* is randomly grouped into J groups, and each group is deleted in turn to recompute our estimates. This is done iereps times and averaged to compute the final jackknife estimates. |
J |
the number of groups B-length vector theta^* is partitioned into to calculate internal standard error |
alpha |
percentiles to be computed for the confidence limits. Providing alpha values below 0.5 is sufficient; upper limits are automatically computed |
progress |
logical for a progress bar in bootstrap calculations |
num_workers |
the number of workers used for parallel processing |
Bootstrap confidence limits correct the standard method of confidence intervals in three ways:
param the bootstrap cdf, G
the bias-correction number z_{0}
the acceleration number a that measures the rate of change in σ_{t_0} as the data changes.
limits: four columns housing information on confidence limits
'bca' shows the empirical bca confidence limits at the alpha percentiles
'std' shows the the standard confidence limits, \hat{θ} + \hat{σ}z_{α}
'pct' gives the percentiles of the sorted B bootstrap replications that correspond to 'bca'
'pct', gives the percentiles of the ordered B bootstrap replications corresponding to the bca limits
'jacksd' is internal standard errors for the bca limits
stats: top line of stats shows 5 estimates, and bottom line gives the internal standard errors for the five quantities below:
theta: f(x), original point estimate of the parameter of interest
'sdboot' is the bootstrap estimate of standard error;
'z0' is the bca bias correction value, in this case quite negative
'a' is the _acceleration_, a component of the bca limits (nearly zero here)
'sdjack' is the jackknife estimate of standard error for theta.
B.mean: bootstrap sample size B, and the mean of the B bootstrap replications \hat{θ^*}
ustats: The bias-corrected estimator '2 * t0 - mean(tt)', and an estimate, 'sdu', of its sampling error
Efron, Bradley, and Trevor J. Hastie. Computer Age Statistical Inference: Algorithms, Evidence, and Data Science. Cambridge University Press, 2017.
Efron, Brad, and Balasubramanian Narasimhan. The Automatic Construction of Bootstrap Confidence Intervals. 2018.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(lfe)
library(uggs)
## create covariates
x1 <- rnorm(1000)
x2 <- rnorm(length(x1))
## fixed effects
fe <- factor(sample(20, length(x1), replace=TRUE))
## effects for fe
fe_effs <- rnorm(nlevels(fe))
## creating left hand side y
u <- rnorm(length(x1))
y <- 2 * x1 + x2 + fe_effs[fe] + u
# create dataframe to pass into uggs
df_test <- as.data.frame(cbind(y, x1, x2, fe))
# function that returns parameter of interest, x1
est_test <- function(df){
m <- felm(y ~ x1 + x2 | fe, df)
as.numeric(coef(m)["x1"])
}
x1_boot <- uggs(df_test, 1000, est_test, jcount = 40, jreps = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.