uggs: Nonparametric bias-corrected and accelerated bootstrap...

Description Usage Arguments Details Value References Examples

Description

This routine computes nonparametric confidence limits for bootstrap estimates.

Usage

1
2
3
uggs(df, B, est, ..., jcount = nrow(df), jreps = 5, iereps = 2,
  J = 10, alpha = c(0.025, 0.05, 0.1), progress = TRUE,
  num_workers = 4, ie_calc = FALSE)

Arguments

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

Details

Bootstrap confidence limits correct the standard method of confidence intervals in three ways:

  1. param the bootstrap cdf, G

  2. the bias-correction number z_{0}

  3. the acceleration number a that measures the rate of change in σ_{t_0} as the data changes.

Value

References

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.

Examples

 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)

yixinsun1216/uggs documentation built on May 28, 2019, 12:05 p.m.