diff --git a/dev/IVexamples/index.html b/dev/IVexamples/index.html index 177c4dc..0dc5f23 100644 --- a/dev/IVexamples/index.html +++ b/dev/IVexamples/index.html @@ -42,4 +42,4 @@ # test same hypothesis in context of LIML regression R = [0 1]; r = [0] -wildboottest(R, r; resp, predexog, predendog, inst, liml=true, clustid=df.industry) +wildboottest(R, r; resp, predexog, predendog, inst, liml=true, clustid=df.industry) diff --git a/dev/OLSexamples/index.html b/dev/OLSexamples/index.html index 09ec86f..719ffe1 100644 --- a/dev/OLSexamples/index.html +++ b/dev/OLSexamples/index.html @@ -79,4 +79,4 @@ # test hypotheses, while imposing model constraint that constant term = 0.2 R1 = [1 0]; r1 = [.2] -wildboottest(R, r; R1, r1, resp, predexog, clustid=df.firm) +wildboottest(R, r; R1, r1, resp, predexog, clustid=df.firm) diff --git a/dev/exported/index.html b/dev/exported/index.html index 7d71e51..3ecf18e 100644 --- a/dev/exported/index.html +++ b/dev/exported/index.html @@ -1,2 +1,2 @@ -Public functions and types · WildBootTests.jl
WildBootTests.wildboottestFunction

wildboottest([T::DataType=Float64,] R::AbstractMatrix, r::AbstractVector; resp, <optional keyword arguments>) -> WildBootTests.BootTestResult

Function to perform wild-bootstrap-based hypothesis test

Positional arguments

  • T::DataType: data type for inputs, results, and computations: Float32 or Float64 (default)
  • R::AbstractMatrix and r::AbstractVector: required matrix and vector expressing the null Rβ=r; see notes below

Required keyword argument

  • resp::AbstractVector: response/dependent variable (y or y₁ in Roodman et al. (2019))

Optional keyword arguments

  • predexog::AbstractVecOrMat: exogenous predictors, including constant term, if any (X/X₁)
  • predendog::AbstractVecOrMat: endogenous predictors (Y₂)
  • inst::AbstractVecOrMat: instruments (X₂)
  • R1::AbstractMatrix and r1::AbstractVector: model constraints; same format as for R and r
  • clustid::AbstractVecOrMat{<:Integer}: data vector/matrix of error and bootstrapping cluster identifiers; see notes
  • nbootclustvar::Integer=size(clustid,2): number of bootstrap-clustering variables
  • nerrclustvar::Integer=nbootclustvar: number of error-clustering variables
  • issorted:Bool=false: time-saving flag: data matrices are already sorted by column types 2, then 3, then 1 (see notes)
  • hetrobust::Bool=true: true unless errors are treated as iid
  • feid::AbstractVector{<:Integer}: data vector for one-way fixed effect group identifier
  • fedfadj::Integer: degrees of freedom that fixed effects (if any) consume; defaults to number of FEs
  • obswt::AbstractVector=[]: observation weight vector; default is equal weighting
  • fweights::Bool=false: true for frequency weights
  • maxmatsize::Number: maximum size of auxilliary weight matrix (v), in gigabytes
  • ptype::Symbol=:symmetric: p value type (:symmetric, :equaltail, :lower, :upper)
  • bootstrapc::Bool=false: true to request bootstrap-c instead of bootstrap-t
  • liml::Bool=false: true for LIML or Fuller LIML
  • fuller::Number: Fuller LIML factor
  • kappa::Number: fixed κ for k-class estimation
  • arubin::Bool=false: true for Anderson-Rubin test
  • small::Bool=true: true to multiply test statistics by G/(G-1) × N/(N-k), where G, N, k are number of clusters, observations, and predictors
  • clusteradj::Bool=true: false to drop G/(G-1) factor
  • clustermin::Bool=false`: for multiway clustering, true to base G/(G-1) factor for all clusterings ]on the smallest G across clusterings
  • jk::Bool=false: true to base the bootstrap data-generating process on residuals jackknifed by bootstrap cluster
  • scorebs::Bool=false: true for score bootstrap instead of wild bootstrap
  • reps::Integer=999: number of bootstrap replications; reps = 0 requests classical Rao (or Wald) test if imposenull = true (or false)
  • imposenull::Bool=true: true to impose null
  • auxwttype::Symbol=:rademacher: auxilliary weight type (:rademacher, :mammen, :webb, :normal, :gamma)
  • rng::AbstractRNG=MersenneTwister(): randon number generator
  • level::Number=.95: significance level (0-1)
  • rtol::Number=1e-3: tolerance for confidence set bound determination
  • madjtype::Symbol=:none: multiple hypothesis adjustment (:none, :bonferroni, :sidak)
  • nH0::Integer=1: number of hypotheses tested, including one being tested now
  • ml::Bool=false: true for (nonlinear) ML estimation
  • scores::AbstractVecOrMat: for ML, pre-computed scores
  • beta::AbstractVector: for ML, parameter estimates
  • A::AbstractMatrix: for ML, covariance estimates
  • gridmin: vector of graph lower bounds; max length 2, missing/NaN entries ask wildboottest() to choose
  • gridmax: vector of graph upper bounds; missing/NaN entries ask wildboottest() to choose
  • gridpoints: vector of number of sampling points; missing/NaN entries ask wildboottest() to choose
  • getdist::Bool=:false: whether to return bootstrapped distribution for t/z/F/χ² statistics; and their numerators
  • getci::Bool=true: whether to return confidence interval
  • getplot::Bool=getci: whether to generate plot data
  • getauxweights::Bool=false: whether to save auxilliary weight matrix (v)

Notes

T, ptype, auxwttype, and madjtype may also be strings. Examples: "Float32" and "webb".

The columns of R in the statement of the null should correspond to those of the matrix [predexog predendog], where predendog is non-empty only in regressions with instruments.

Order the columns of clustid this way:

  1. Variables only used to define bootstrapping clusters, as in the subcluster bootstrap.
  2. Variables used to define both bootstrapping and error clusters.
  3. Variables only used to define error clusters.

nbootclustvar is then the number of columns of type 1 or 2; nerrclustvar is the number of columns of type 2 or 3. Typically clustid is a single column of type 2 and nbootclustvar and nerrclustvar default to 1.

wildboottest() does not handle missing data values: all data and identifier matrices must be restricted to the estimation sample.

source
WildBootTests.plotpointsFunction

Return data for confidence plot of test. Return value is a 2-tuple with named entries X and p holding the confidence sampling locations and p values respectively. X is in turn a 1- or 2-tuple of vectors of sampling coordinates for each dimension of the tested hypothesis.

source
+Public functions and types · WildBootTests.jl
WildBootTests.wildboottestFunction

wildboottest([T::DataType=Float64,] R::AbstractMatrix, r::AbstractVector; resp, <optional keyword arguments>) -> WildBootTests.BootTestResult

Function to perform wild-bootstrap-based hypothesis test

Positional arguments

  • T::DataType: data type for inputs, results, and computations: Float32 or Float64 (default)
  • R::AbstractMatrix and r::AbstractVector: required matrix and vector expressing the null Rβ=r; see notes below

Required keyword argument

  • resp::AbstractVector: response/dependent variable (y or y₁ in Roodman et al. (2019))

Optional keyword arguments

  • predexog::AbstractVecOrMat: exogenous predictors, including constant term, if any (X/X₁)
  • predendog::AbstractVecOrMat: endogenous predictors (Y₂)
  • inst::AbstractVecOrMat: instruments (X₂)
  • R1::AbstractMatrix and r1::AbstractVector: model constraints; same format as for R and r
  • clustid::AbstractVecOrMat{<:Integer}: data vector/matrix of error and bootstrapping cluster identifiers; see notes
  • nbootclustvar::Integer=size(clustid,2): number of bootstrap-clustering variables
  • nerrclustvar::Integer=nbootclustvar: number of error-clustering variables
  • issorted:Bool=false: time-saving flag: data matrices are already sorted by column types 2, then 3, then 1 (see notes)
  • hetrobust::Bool=true: true unless errors are treated as iid
  • feid::AbstractVector{<:Integer}: data vector for one-way fixed effect group identifier
  • fedfadj::Integer: degrees of freedom that fixed effects (if any) consume; defaults to number of FEs
  • obswt::AbstractVector=[]: observation weight vector; default is equal weighting
  • fweights::Bool=false: true for frequency weights
  • maxmatsize::Number: maximum size of auxilliary weight matrix (v), in gigabytes
  • ptype::Symbol=:symmetric: p value type (:symmetric, :equaltail, :lower, :upper)
  • bootstrapc::Bool=false: true to request bootstrap-c instead of bootstrap-t
  • liml::Bool=false: true for LIML or Fuller LIML
  • fuller::Number: Fuller LIML factor
  • kappa::Number: fixed κ for k-class estimation
  • arubin::Bool=false: true for Anderson-Rubin test
  • small::Bool=true: true to multiply test statistics by G/(G-1) × N/(N-k), where G, N, k are number of clusters, observations, and predictors
  • clusteradj::Bool=true: false to drop G/(G-1) factor
  • clustermin::Bool=false`: for multiway clustering, true to base G/(G-1) factor for all clusterings ]on the smallest G across clusterings
  • jk::Bool=false: true to base the bootstrap data-generating process on residuals jackknifed by bootstrap cluster
  • scorebs::Bool=false: true for score bootstrap instead of wild bootstrap
  • reps::Integer=999: number of bootstrap replications; reps = 0 requests classical Rao (or Wald) test if imposenull = true (or false)
  • imposenull::Bool=true: true to impose null
  • auxwttype::Symbol=:rademacher: auxilliary weight type (:rademacher, :mammen, :webb, :normal, :gamma)
  • rng::AbstractRNG=MersenneTwister(): randon number generator
  • level::Number=.95: significance level (0-1)
  • rtol::Number=1e-3: tolerance for confidence set bound determination
  • madjtype::Symbol=:none: multiple hypothesis adjustment (:none, :bonferroni, :sidak)
  • nH0::Integer=1: number of hypotheses tested, including one being tested now
  • ml::Bool=false: true for (nonlinear) ML estimation
  • scores::AbstractVecOrMat: for ML, pre-computed scores
  • beta::AbstractVector: for ML, parameter estimates
  • A::AbstractMatrix: for ML, covariance estimates
  • gridmin: vector of graph lower bounds; max length 2, missing/NaN entries ask wildboottest() to choose
  • gridmax: vector of graph upper bounds; missing/NaN entries ask wildboottest() to choose
  • gridpoints: vector of number of sampling points; missing/NaN entries ask wildboottest() to choose
  • getdist::Bool=:false: whether to return bootstrapped distribution for t/z/F/χ² statistics; and their numerators
  • getci::Bool=true: whether to return confidence interval
  • getplot::Bool=getci: whether to generate plot data
  • getauxweights::Bool=false: whether to save auxilliary weight matrix (v)

Notes

T, ptype, auxwttype, and madjtype may also be strings. Examples: "Float32" and "webb".

The columns of R in the statement of the null should correspond to those of the matrix [predexog predendog], where predendog is non-empty only in regressions with instruments.

Order the columns of clustid this way:

  1. Variables only used to define bootstrapping clusters, as in the subcluster bootstrap.
  2. Variables used to define both bootstrapping and error clusters.
  3. Variables only used to define error clusters.

nbootclustvar is then the number of columns of type 1 or 2; nerrclustvar is the number of columns of type 2 or 3. Typically clustid is a single column of type 2 and nbootclustvar and nerrclustvar default to 1.

wildboottest() does not handle missing data values: all data and identifier matrices must be restricted to the estimation sample.

source
WildBootTests.plotpointsFunction

Return data for confidence plot of test. Return value is a 2-tuple with named entries X and p holding the confidence sampling locations and p values respectively. X is in turn a 1- or 2-tuple of vectors of sampling coordinates for each dimension of the tested hypothesis.

source
diff --git a/dev/index.html b/dev/index.html index c859c6f..b2675f9 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Overview · WildBootTests.jl

WildBootTests.jl performs wild bootstrap-based hypothesis tests at extreme speed. It is intended mainly for linear models: ordinary least squares (OLS) and instrumental variables/two-stage least squares (IV/2SLS). For an introduction to the wild bootstrap and the algorithms deployed here, see Roodman et al. (2019).

The package offers and/or supports:

  • The wild bootstrap for OLS (Wu 1986).
  • The Wild Restricted Efficient bootstrap (WRE) for IV/2SLS/LIML (Davidson and MacKinnon 2010).
  • The subcluster bootstrap (MacKinnon and Webb 2018).
  • Non-bootstrapped Wald, Rao, and Anderson-Rubin tests, optionally with multiway clustering.
  • Confidence intervals formed by inverting the test and iteratively searching for bounds.
  • Multiway clustering.
  • Arbitrary and multiple linear hypotheses in the parameters.
  • Maintained linear constraints on the model (restricted OLS, IV/2SLS/LIML).
  • One-way fixed effects.
  • Generation of data for plotting of confidence curves or surfaces after one- or two-dimensional hypothesis tests.

WildBootTests.jl incorporates order-of-magnitude algorithmic speed-ups developed since Roodman et al. (2019) for OLS and IV/2SLS. And it exploits the efficiency of Julia, for example by offering single-precision (Float32) computation.

The interface is low-level: the exported function wildboottest() accepts scalars, vectors, and matrices, not DataFrames or results from estimation functions such as lm(). This design minimizes the package's dependency footprint while making the core functionality available to multiple programming environments, including Julia, R (through JuliaConnectoR), and Python (through PyJulia). A separate package will provide a higher-level Julia interface.

wildboottest() accepts many optional arguments. Most correspond to options of the Stata package boottest, which are documented in Roodman et al. (2019), §7. Julia-specific additions include an optional first argument T, which can be Float32 or Float64 to specify the precision of computation; and rng, which takes a random number generator such as MersenneTwister(2302394).

On latency

The first time you run wildboottest() in a session, Julia's just-in-time compilation will take ~10 seconds. The same will happen the first time you switch between Float32 and Float64 calculations, or between OLS and IV/2SLS estimation.

+Overview · WildBootTests.jl

WildBootTests.jl performs wild bootstrap-based hypothesis tests at extreme speed. It is intended mainly for linear models: ordinary least squares (OLS) and instrumental variables/two-stage least squares (IV/2SLS). For an introduction to the wild bootstrap and the algorithms deployed here, see Roodman et al. (2019).

The package offers and/or supports:

  • The wild bootstrap for OLS (Wu 1986).
  • The Wild Restricted Efficient bootstrap (WRE) for IV/2SLS/LIML (Davidson and MacKinnon 2010).
  • The subcluster bootstrap (MacKinnon and Webb 2018).
  • Non-bootstrapped Wald, Rao, and Anderson-Rubin tests, optionally with multiway clustering.
  • Confidence intervals formed by inverting the test and iteratively searching for bounds.
  • Multiway clustering.
  • Arbitrary and multiple linear hypotheses in the parameters.
  • Maintained linear constraints on the model (restricted OLS, IV/2SLS/LIML).
  • One-way fixed effects.
  • Generation of data for plotting of confidence curves or surfaces after one- or two-dimensional hypothesis tests.

WildBootTests.jl incorporates order-of-magnitude algorithmic speed-ups developed since Roodman et al. (2019) for OLS and IV/2SLS. And it exploits the efficiency of Julia, for example by offering single-precision (Float32) computation.

The interface is low-level: the exported function wildboottest() accepts scalars, vectors, and matrices, not DataFrames or results from estimation functions such as lm(). This design minimizes the package's dependency footprint while making the core functionality available to multiple programming environments, including Julia, R (through JuliaConnectoR), and Python (through PyJulia). A separate package will provide a higher-level Julia interface.

wildboottest() accepts many optional arguments. Most correspond to options of the Stata package boottest, which are documented in Roodman et al. (2019), §7. Julia-specific additions include an optional first argument T, which can be Float32 or Float64 to specify the precision of computation; and rng, which takes a random number generator such as MersenneTwister(2302394).

On latency

The first time you run wildboottest() in a session, Julia's just-in-time compilation will take ~10 seconds. The same will happen the first time you switch between Float32 and Float64 calculations, or between OLS and IV/2SLS estimation.

diff --git a/dev/search/index.html b/dev/search/index.html index 6e4733d..2df092e 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · WildBootTests.jl

Loading search...

    +Search · WildBootTests.jl

    Loading search...