comp_boot_mul_wgt is a Helper function for comp_boot_mul to generate different types of multiplier bootstrap weights. This section is inspired by the weighttype option in the Stata boottest package.

comp_boot_mul_wgt(n, weights_type)

Arguments

n

The number of random multiplier bootstrap weights to generate.

weights_type

The type of multiplier bootstrap weights to generate. Based on the weighttype option in the Stata boottest package, this can only take the following five pre-specified values "rademacher", "mammen", "webb", "std_gaussian", "gamma". A brief description of each type is as follows. The "rademacher" weights are sampled from the two point Rademacher distribution which takes values \(\{1, 1\}\), with equal probability. The "mammen" weights are sampled from the two point Mammen distribution which has takes values \(\{\phi, 1 - \phi\}\), with probabilities \(\{\frac{\phi}{\sqrt{5}}, 1 - \frac{\phi}{\sqrt{5}}\}\), respectively. The "webb" weights are sampled from the six point Webb distribution which has takes values \(\{\pm \sqrt{\frac{3}{2}}, \pm \sqrt{\frac{1}{2}}, \pm 1 \}\), with equal probability. The "std_gaussian" weights are sampled from the standard Gaussian (normal) distribution with mean = \(0\), and variance = \(1\). Finally, the "gamma" weights are sampled from the Gamma distribution with shape parameter = \(4\), and scale parameter = \(1\). For more details on these weight types see see Roodman et al. (2019) .

Value

A numeric vector of n (sampled with replacement) random multiplier bootstrap weights based on the specified multiplier weights type.

References

Roodman D, Nielsen MØ, MacKinnon JG, Webb MD (2019). “Fast and wild: Bootstrap inference in Stata using boottest.” The Stata Journal, 19(1), 4--60.

Examples

if (FALSE) { set.seed(824908) # Number of multiplier weights to generate n <- 1000 # Generate the different type of multiplier weights rademacher_w <- comp_boot_mul_wgt( n = n, weights_type = "rademacher" ) mammen_w <- comp_boot_mul_wgt(n = n, weights_type = "mammen") webb_w <- comp_boot_mul_wgt(n = n, weights_type = "webb") std_gaussian_w <- comp_boot_mul_wgt( n = n, weights_type = "std_gaussian" ) gamma_w <- comp_boot_mul_wgt(n = n, weights_type = "gamma") }