R/ols-boot-multiplier.R
comp_boot_mul_wgt.Rd
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)
n | The number of random multiplier bootstrap weights to generate. |
---|---|
weights_type | The type of multiplier bootstrap weights to generate.
Based on the |
A numeric vector of n (sampled with replacement) random multiplier bootstrap weights based on the specified multiplier weights type.
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.
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") }