# doc-cache created by Octave 10.1.0
# name: cache
# type: cell
# rows: 3
# columns: 15
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
boot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4267
 -- Function File: BOOTSAM = boot (N, NBOOT)
 -- Function File: BOOTSAM = boot (X, NBOOT)
 -- Function File: BOOTSAM = boot (..., NBOOT, LOO)
 -- Function File: BOOTSAM = boot (..., NBOOT, LOO, SEED)
 -- Function File: BOOTSAM = boot (..., NBOOT, LOO, SEED, WEIGHTS)

     'BOOTSAM = boot (N, NBOOT)' generates NBOOT bootstrap samples of length N.
     The samples generated are composed of indices within the range 1:N, which
     are chosen by random resampling with replacement [1]. N and NBOOT must be
     positive integers. The returned value, BOOTSAM, is a matrix of indices,
     with N rows and NBOOT columns. The efficiency of the bootstrap simulation
     is ensured by sampling each of the indices exactly NBOOT times, for first-
     order balance [2-3]. Balanced resampling only applies when NBOOT > 1.

     'BOOTSAM = boot (X, NBOOT)' generates NBOOT bootstrap samples, each the
     same length as X (N). X must be a numeric vector, and NBOOT must be
     positive integer. BOOTSAM is a matrix of values from X, with N rows
     and NBOOT columns. The samples generated contains values of X, which
     are chosen by balanced bootstrap resampling as described above [1-3].
     Balanced resampling only applies when NBOOT > 1.

     'BOOTSAM = boot (..., NBOOT, LOO)' sets the resampling method. If LOO
     is false, the resampling method used is balanced bootstrap resampling.
     If LOO is true, the resampling method used is balanced bootknife
     resampling [4]. The latter involves creating leave-one-out jackknife
     samples of size N - 1, and then drawing resamples of size N with
     replacement from the jackknife samples, thereby incorporating Bessel's
     correction into the resampling procedure. LOO must be a scalar logical
     value. The default value of LOO is false.

     'BOOTSAM = boot (..., NBOOT, LOO, SEED)' sets a seed to initialize
     the pseudo-random number generator to make resampling reproducible between
     calls to the boot function. Note that the mex function compiled from the
     source code boot.cpp is not thread-safe. Below is an example of a line of
     code one can run in Octave/Matlab before attempting parallel operation of
     boot.mex in order to ensure that the initial random seeds of each thread
     are unique:
       • In Octave:
            pararrayfun (nproc, @boot, 1, 1, false, 1:nproc)
       • In Matlab:
            ncpus = feature('numcores'); 
            parfor i = 1:ncpus; boot (1, 1, false, i); end;

     'BOOTSAM = boot (..., NBOOT, LOO, SEED, WEIGHTS)' sets a weight
     vector of length N. If WEIGHTS is empty or not provided, the default 
     is a vector of length N, with each element equal to NBOOT (i.e. uniform
     weighting). Each element of WEIGHTS is the number of times that the
     corresponding index (or element in X) is represented in BOOTSAM.
     Therefore, the sum of WEIGHTS must equal N * NBOOT. 

  Bibliography:
  [1] Efron, and Tibshirani (1993) An Introduction to the
        Bootstrap. New York, NY: Chapman & Hall
  [2] Davison et al. (1986) Efficient Bootstrap Simulation.
        Biometrika, 73: 555-66
  [3] Booth, Hall and Wood (1993) Balanced Importance Resampling
        for the Bootstrap. The Annals of Statistics. 21(1):286-298
  [4] Hesterberg T.C. (2004) Unbiasing the Bootstrap—Bootknife Sampling 
        vs. Smoothing; Proceedings of the Section on Statistics & the 
        Environment. Alexandria, VA: American Statistical Association.

  boot (version 2023.01.28)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: BOOTSAM = boot (N, NBOOT)
 -- Function File: BOOTSAM = boo...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
bootbayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7540
 -- Function File: bootbayes (Y)
 -- Function File: bootbayes (Y, X)
 -- Function File: bootbayes (Y, X, CLUSTID)
 -- Function File: bootbayes (Y, X, BLOCKSZ)
 -- Function File: bootbayes (Y, X, ..., NBOOT)
 -- Function File: bootbayes (Y, X, ..., NBOOT, PROB)
 -- Function File: bootbayes (Y, X, ..., NBOOT, PROB, PRIOR)
 -- Function File: bootbayes (Y, X, ..., NBOOT, PROB, PRIOR, SEED)
 -- Function File: bootbayes (Y, X, ..., NBOOT, PROB, PRIOR, SEED, L)
 -- Function File: STATS = bootbayes (Y, ...)
 -- Function File: [STATS, BOOTSTAT] = bootbayes (Y, ...)

     'bootbayes (Y)' performs Bayesian nonparametric bootstrap [1] to create
     1999 bootstrap statistics, each representing the weighted mean(s) of the
     column vector (or column-major matrix), Y, using a vector of weights
     randomly generated from a symmetric Dirichlet distribution. The resulting
     bootstrap (or posterior [1,2]) distribution(s) is/are summarised with the
     following statistics printed to the standard output:
        - original: the mean(s) of the data column(s) of Y
        - bias: bootstrap bias estimate(s)
        - median: the median of the posterior distribution(s)
        - stdev: the standard deviation of the posterior distribution(s)
        - CI_lower: lower bound(s) of the 95% credible interval
        - CI_upper: upper bound(s) of the 95% credible interval
          By default, the credible intervals are shortest probability
          intervals, which represent a more computationally stable version
          of the highest posterior density interval [3].

     'bootbayes (Y, X)' also specifies the design matrix (X) for least squares
     regression of Y on X. X should be a column vector or matrix the same
     number of rows as Y. If the X input argument is empty, the default for X
     is a column of ones (i.e. intercept only) and thus the statistic computed
     reduces to the mean (as above). The statistics calculated and returned in
     the output then relate to the coefficients from the regression of Y on X.
     Y must be a column vector (not matrix) for regression.

     'bootbayes (Y, X, CLUSTID)' specifies a vector or cell array of numbers
     or strings respectively to be used as cluster labels or identifiers.
     Rows in Y (and X) with the same CLUSTID value are treated as clusters with
     dependent errors. Rows of Y (and X) assigned to a particular cluster
     will have identical weights during Bayesian bootstrap. If empty (default),
     no clustered resampling is performed and all errors are treated as
     independent.

     'bootbayes (Y, X, BLOCKSZ)' specifies a scalar, which sets the block size
     for bootstrapping when the residuals have serial dependence. Identical
     weights are assigned within each (consecutive) block of length BLOCKSZ
     during Bayesian bootstrap. Rows of Y (and X) within the same block are
     treated as having dependent errors. If empty (default), no block
     resampling is performed and all errors are treated as independent.

     'bootbayes (Y, X, ..., NBOOT)' specifies the number of bootstrap resamples,
     where NBOOT must be a positive integer. If empty, the default value of
     NBOOT is 1999.

     'bootbayes (Y, X, ..., NBOOT, PROB)' where PROB is numeric and sets the
     lower and upper bounds of the credible interval(s). The value(s) of PROB
     must be between 0 and 1. PROB can either be:
       <> scalar: To set the central mass of shortest probability
                  intervals (SPI) to 100*(1-PROB)%
       <> vector: A pair of probabilities defining the lower and upper
                  percentiles of the credible interval(s) as 100*(PROB(1))%
                  and 100*(PROB(2))% respectively. 
          Credible intervals are not calculated when the value(s) of PROB
          is/are NaN. The default value of PROB is 0.95.

     'bootbayes (Y, X, ..., NBOOT, PROB, PRIOR)' accepts a positive real
     numeric scalar to parametrize the form of the symmetric Dirichlet
     distribution. The Dirichlet distribution is the conjugate PRIOR used to
     randomly generate weights for linear least squares fitting of the observed
     data, and subsequently to estimate the posterior for the regression
     coefficients by Bayesian bootstrap.
        If PRIOR is not provided or is empty, and the model is not intercept
     -only, then the default value of PRIOR is 1, which corresponds to Bayes
     rule: a uniform (or flat) Dirichlet distribution (over all points in its
     support). Otherwise, the value of PRIOR is set to 'auto'.
        The value 'auto' sets a value for PRIOR that effectively incorporates
     Bessel's correction a priori. Thus, for a sample size of N and PRIOR set
     to 'auto', the variance of the posterior (i.e. BOOTSTAT) becomes an
     unbiased estimator of the sampling variance. For example, when the PRIOR
     is 1, the prior is flat over the range of the data Y, approximated by the
     interval +/- 2 * std (Y, 1), which is 4 * std (Y, 1) wide according to
     the range rule of thumb for a normal distribution. Therefore, a PRIOR
     set to 'auto' is flat over the approximate interval +/- 2 * std (Y, 0).
     The calculation used for 'auto' is as follows:

          PRIOR = 1 - 2 / N

        For block or cluster bootstrap, N corresponds to the number of blocks
     or clusters (i.e. the number of independent sampling units). When N = 2,
     the PRIOR is equal to 0, which is the Haldane prior, in which case:

         std (BOOTSTAT, 1, 2) ~ std (Y, 1) == std (Y, 0) / sqrt (N) 

     'bootbayes (Y, X, ..., NBOOT, PROB, PRIOR, SEED)' initialises the
     Mersenne Twister random number generator using an integer SEED value so
     that 'bootbayes' results are reproducible.

     'bootbayes (Y, X, ..., NBOOT, PROB, PRIOR, SEED, L)' multiplies the
     regression coefficients by the hypothesis matrix L. If L is not provided
     or is empty, it will assume the default value of 1 (i.e. no change to
     the design). Otherwise, L must have the same number of rows as the number
     of columns in X.

     'STATS = bootbayes (...) returns a structure with the following fields:
     original, bias, median, stdev, CI_lower, CI_upper & prior.

     '[STATS, BOOTSTAT] = bootbayes (...)  also returns the a vector (or
     matrix) of bootstrap statistics (BOOTSTAT) calculated over the bootstrap
     resamples.

  Bibliography:
  [1] Rubin (1981) The Bayesian Bootstrap. Ann. Statist. 9(1):130-134
  [2] Weng (1989) On a Second-Order Asymptotic property of the Bayesian
        Bootstrap Mean. Ann. Statist. 17(2):705-710
  [3] Liu, Gelman & Zheng (2015). Simulation-efficient shortest probability
        intervals. Statistics and Computing, 25(4), 809–819. 

  bootbayes (version 2023.07.06)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootbayes (Y)
 -- Function File: bootbayes (Y, X)
 -- Func...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
bootcdf


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2010
 -- Function File: [x, F] = bootcdf (y)
 -- Function File: [x, F] = bootcdf (y, trim)
 -- Function File: [x, F] = bootcdf (y, trim, m)
 -- Function File: [x, F] = bootcdf (y, trim, m, tol)
 -- Function File: [x, F, P] = bootcdf (...)

     '[x, F] = bootcdf (y)' computes the empirical cumulative distribution
     function (ECDF) of the vector y of length N. This funtction accounts for
     the presence of ties and so is suitable for computing the ECDF of
     bootstrap statistics.

     '[x, F] = bootcdf (y, trim)' removes redundant rows of the ECDF when trim
     is true. When trim is false, x and F are are the same length as y. The
     default is true.

     '[x, F] = bootcdf (y, trim, m)' specifies the denominator in the
     calculation of F as (N + m). Accepted values of m are 0 or 1, with the
     default being 0. When m is 1, quantiles formed from x and F are akin to
     qtype 6 in the R quantile function.

     '[x, F] = bootcdf (y, trim, m, tol)' applies a tolerance for the absolute
     difference in y values that constitutes a tie. The default tolerance
     is 1e-12 for double precision, or 1e-6 for single precision.

     '[x, F, P] = bootcdf (...)' also returns the distribution of P values.

  bootcdf (version 2023.07.05)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: [x, F] = bootcdf (y)
 -- Function File: [x, F] = bootcdf (...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
bootci


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8043
 -- Function File: CI = bootci (NBOOT, BOOTFUN, D)
 -- Function File: CI = bootci (NBOOT, BOOTFUN, D1,...,DN)
 -- Function File: CI = bootci (NBOOT, {BOOTFUN, D}, NAME, VALUE)
 -- Function File: CI = bootci (NBOOT, {BOOTFUN, D1, ..., DN}, NAME, VALUE)
 -- Function File: CI = bootci (...,'type', TYPE)
 -- Function File: CI = bootci (...,'type', 'stud', 'nbootstd', NBOOTSTD)
 -- Function File: CI = bootci (...,'type', 'cal', 'nbootcal', NBOOTCAL)
 -- Function File: CI = bootci (...,'alpha', ALPHA)
 -- Function File: CI = bootci (...,'strata', STRATA)
 -- Function File: CI = bootci (...,'loo', LOO)
 -- Function File: CI = bootci (...,'seed', SEED)
 -- Function File: CI = bootci (...,'Options', PAROPT)
 -- Function File: [CI, BOOTSTAT] = bootci (...)

     'CI = bootci (NBOOT, BOOTFUN, D)' draws NBOOT bootstrap resamples from
     the rows of a data sample D and returns 95% confidence intervals (CI) for
     the bootstrap statistics computed by BOOTFUN [1]. BOOTFUN is a function 
     handle (e.g. specified with @), or a string indicating the function name. 
     The third input argument, data D (a column vector or a matrix), is used
     as input for BOOTFUN. The bootstrap resampling method yields first-order
     balance [2-3].

     'CI = bootci (NBOOT, BOOTFUN, D1,...,DN)' is as above except that the
     third and subsequent numeric input arguments are data vectors that are
     used to create inputs for bootfun.

     'CI = bootci (NBOOT, {BOOTFUN, D}, NAME, VALUE)' is as above but includes
     setting optional parameters using Name-Value pairs.

     'CI = bootci (NBOOT, {BOOTFUN, D1, ..., DN}, NAME, VALUE)' is as above but
     includes setting optional parameters using NAME-VALUE pairs.

     bootci can take a number of optional parameters as NAME-VALUE pairs:

     'CI = bootci (..., 'alpha', ALPHA)' where ALPHA sets the lower and upper 
     bounds of the confidence interval(s). The value of ALPHA must be between
     0 and 1. The nominal lower and upper percentiles of the confidence
     intervals CI are then 100*(ALPHA/2)% and 100*(1-ALPHA/2)% respectively,
     and nominal central coverage of the intervals is 100*(1-ALPHA)%. The
     default value of ALPHA is 0.05.

     'CI = bootci (..., 'type', TYPE)' computes bootstrap confidence interval 
     CI using one of the following methods:
      <> 'norm' or 'normal': Using bootstrap bias and standard error [4].
      <> 'per' or 'percentile': Percentile method [1,4].
      <> 'basic': Basic bootstrap method [1,4].
      <> 'bca': Bias-corrected and accelerated method [5,6] (Default).
      <> 'stud' or 'student': Studentized bootstrap (bootstrap-t) [1,4].
      <> 'cal': Calibrated percentile method (by double bootstrap [7]).
       Note that when BOOTFUN is the mean, percentile, basic and bca intervals
       are automatically expanded using Student's t-distribution in order to
       improve coverage for small samples [8]. The bootstrap-t method includes
       an additive correction to stabilize the variance when the sample size
       is small [9].

     'CI = bootci (..., 'type', 'stud', 'nbootstd', NBOOTSTD)' computes the
     Studentized bootstrap confidence intervals CI, with the standard errors
     of the bootstrap statistics estimated automatically using resampling
     methods. NBOOTSTD is a positive integer value > 0 defining the number
     of resamples. Standard errors are computed using NBOOTSTD bootstrap
     resamples. The default value of NBOOTSTD is 100.

     'CI = bootci (..., 'type', 'cal', 'nbootcal', NBOOTCAL)' computes the
     calibrated percentile bootstrap confidence intervals CI, with the
     calibrated percentiles of the bootstrap statistics estimated from NBOOTCAL
     bootstrap data samples. NBOOTCAL is a positive integer value. The default
     value of NBOOTCAL is 199.

     'CI = bootci (..., 'strata', STRATA)' sets STRATA, which are identifiers
     that define the grouping of the DATA rows for stratified bootstrap
     resampling. STRATA should be a column vector or cell array with the same
     number of rows as the DATA.

     'CI = bootci (..., 'loo', LOO)' is a logical scalar that specifies whether
     the resamples of size n should be obtained by sampling from the original
     data (false) or from Leave-One-Out (LOO) jackknife samples (true) of the
     data - otherwise known as bootknife resampling [10]. Default is false.

     'CI = bootci (..., 'seed', SEED)' initialises the Mersenne Twister random
     number generator using an integer SEED value so that bootci results are
     reproducible.

     'CI = bootci (..., 'Options', PAROPT)' specifies options that govern if
     and how to perform bootstrap iterations using multiple processors (if the
     Parallel Computing Toolbox or Octave Parallel package is available). This
     argument is a structure with the following recognised fields:
       <> 'UseParallel':  If true, use parallel processes to accelerate
                          bootstrap computations on multicore machines,
                          specifically non-vectorized function evaluations,
                          double bootstrap resampling and jackknife function
                          evaluations. Default is false for serial computation.
                          In MATLAB, the default is true if a parallel pool
                          has already been started. 
       <> 'nproc':        nproc sets the number of parallel processes

     '[CI, BOOTSTAT] = bootci (...)' also returns the bootstrap statistics
     used to calculate the confidence intervals CI.
   
     '[CI, BOOTSTAT, BOOTSAM] = bootci (...)' also returns BOOTSAM, a matrix 
     of indices from the bootstrap. Each column in BOOTSAM corresponds to one 
     bootstrap sample and contains the row indices of the values drawn from 
     the nonscalar data argument to create that sample.

  Bibliography:
  [1] Efron, and Tibshirani (1993) An Introduction to the
        Bootstrap. New York, NY: Chapman & Hall
  [2] Davison et al. (1986) Efficient Bootstrap Simulation.
        Biometrika, 73: 555-66
  [3] Booth, Hall and Wood (1993) Balanced Importance Resampling
        for the Bootstrap. The Annals of Statistics. 21(1):286-298
  [4] Davison and Hinkley (1997) Bootstrap Methods and their Application.
        (Cambridge University Press)
  [5] Efron (1987) Better Bootstrap Confidence Intervals. JASA, 
        82(397): 171-185 
  [6] Efron, and Tibshirani (1993) An Introduction to the
        Bootstrap. New York, NY: Chapman & Hall
  [7] Hall, Lee and Young (2000) Importance of interpolation when
        constructing double-bootstrap confidence intervals. Journal
        of the Royal Statistical Society. Series B. 62(3): 479-491
  [8] Hesterberg, Tim (2014), What Teachers Should Know about the 
        Bootstrap: Resampling in the Undergraduate Statistics Curriculum, 
        http://arxiv.org/abs/1411.5279
  [9] Polansky (2000) Stabilizing bootstrap-t confidence intervals
        for small samples. Can J Stat. 28(3):501-516
  [10] Hesterberg T.C. (2004) Unbiasing the Bootstrap—Bootknife Sampling 
        vs. Smoothing; Proceedings of the Section on Statistics & the 
        Environment. Alexandria, VA: American Statistical Association.

  bootci (version 2023.07.04)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: CI = bootci (NBOOT, BOOTFUN, D)
 -- Function File: CI = bo...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
bootclust


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6994
 -- Function File: bootclust (DATA)
 -- Function File: bootclust (DATA, NBOOT)
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN)
 -- Function File: bootclust ({D1, D2, ...}, NBOOT, BOOTFUN)
 -- Function File: bootclust (DATA, NBOOT, {BOOTFUN, ...})
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN, ALPHA)
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID)
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTSZ)
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID, LOO)
 -- Function File: bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID, LOO, SEED)
 -- Function File: STATS = bootclust (...)
 -- Function File: [STATS, BOOTSTAT] = bootclust (...)

     'bootclust (DATA)' uses nonparametric balanced bootstrap resampling
     to generate 1999 resamples from clusters of rows of the DATA (column
     vector or matrix). By default, each rows is it's own cluster (i.e. no
     clustering). The means of the resamples are then computed and the
     following statistics are displayed:
        - original: the original estimate(s) calculated by BOOTFUN and the DATA
        - bias: bootstrap bias of the estimate(s)
        - std_error: bootstrap standard error of the estimate(s)
        - CI_lower: lower bound(s) of the 95% bootstrap confidence interval
        - CI_upper: upper bound(s) of the 95% bootstrap confidence interval

     'bootclust (DATA, NBOOT)' specifies the number of bootstrap resamples,
     where NBOOT is a scalar, positive integer corresponding to the number
     of bootstrap resamples. THe default value of NBOOT is the scalar: 1999.

     'bootclust (DATA, NBOOT, BOOTFUN)' also specifies BOOTFUN: the function
     calculated on the original sample and the bootstrap resamples. BOOTFUN
     must be either a:
       <> function handle or anonymous function,
       <> string of function name, or
       <> a cell array where the first cell is one of the above function
          definitions and the remaining cells are (additional) input arguments 
          to that function (other than the data arguments).
        In all cases BOOTFUN must take DATA for the initial input argument(s).
        BOOTFUN can return a scalar or any multidimensional numeric variable,
        but the output will be reshaped as a column vector. BOOTFUN must
        calculate a statistic representative of the finite data sample; it
        should NOT be an estimate of a population parameter (unless they are
        one of the same). If BOOTFUN is @mean or 'mean', narrowness bias of
        the confidence intervals for single bootstrap are reduced by expanding
        the probabilities of the percentiles using Student's t-distribution
        [1]. By default, BOOTFUN is @mean.

     'bootclust ({D1, D2, ...}, NBOOT, BOOTFUN)' resamples from the clusters
     of rows of the data vectors D1, D2 etc and the resamples are passed onto
     BOOTFUN as multiple data input arguments. All data vectors and matrices
     (D1, D2 etc) must have the same number of rows.

     'bootclust (DATA, NBOOT, BOOTFUN, ALPHA)', where ALPHA is numeric
     and sets the lower and upper bounds of the confidence interval(s). The
     value(s) of ALPHA must be between 0 and 1. ALPHA can either be:
       <> scalar: To set the (nominal) central coverage of equal-tailed
                  percentile confidence intervals to 100*(1-ALPHA)%.
       <> vector: A pair of probabilities defining the (nominal) lower and
                  upper percentiles of the confidence interval(s) as
                  100*(ALPHA(1))% and 100*(ALPHA(2))% respectively. The
                  percentiles are bias-corrected and accelerated (BCa) [2].
        The default value of ALPHA is the vector: [.025, .975], for a 95%
        BCa confidence interval.

     'bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID)' also sets CLUSTID,
     which are identifiers that define the grouping of the DATA rows for
     cluster bootstrap case resampling. CLUSTID should be a column vector or
     cell array with the same number of rows as the DATA. Rows in DATA with
     the same CLUSTID value are treated as clusters of observations that are
     resampled together.

     'bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTSZ)' groups consecutive
     DATA rows into clusters of length CLUSTSZ. This is equivalent to block
     bootstrap resampling. By default, CLUSTSZ is 1.

     'bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID, LOO)' sets the
     resampling method. If LOO is false, the resampling method used is
     balanced bootstrap resampling. If LOO is true, the resampling method used
     is balanced bootknife resampling [3]. Where N is the number of clusters,
     bootknife cluster resampling involves creating leave-one-out jackknife
     samples of size N - 1, and then drawing resamples of size N with
     replacement from the jackknife samples, thereby incorporating Bessel's
     correction into the resampling procedure. LOO must be a scalar logical
     value. The default value of LOO is false.

     'bootclust (DATA, NBOOT, BOOTFUN, ALPHA, CLUSTID, LOO, SEED)' initialises
     the Mersenne Twister random number generator using an integer SEED value
     so that bootclust results are reproducible.

     'STATS = bootclust (...)' returns a structure with the following fields
     (defined above): original, bias, std_error, CI_lower, CI_upper.

     '[STATS, BOOTSTAT] = bootclust (...)' returns BOOTSTAT, a vector or matrix
     of bootstrap statistics calculated over the bootstrap resamples.

  REQUIREMENTS:
    The function file boot.m (or better boot.mex) and bootcdf, which are
    distributed with the statistics-bootstrap package.

  BIBLIOGRAPHY:
  [1] Hesterberg, Tim (2014), What Teachers Should Know about the 
        Bootstrap: Resampling in the Undergraduate Statistics Curriculum, 
        http://arxiv.org/abs/1411.5279
  [2] Efron, and Tibshirani (1993) An Introduction to the Bootstrap. 
        New York, NY: Chapman & Hall
  [3] Hesterberg T.C. (2004) Unbiasing the Bootstrap—Bootknife Sampling 
        vs. Smoothing; Proceedings of the Section on Statistics & the 
        Environment. Alexandria, VA: American Statistical Association.

  bootclust (version 2023.09.20)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootclust (DATA)
 -- Function File: bootclust (DATA, NBOOT...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
bootknife


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9908
 -- Function File: bootknife (DATA)
 -- Function File: bootknife (DATA, NBOOT)
 -- Function File: bootknife (DATA, NBOOT, BOOTFUN)
 -- Function File: bootknife ({D1, D2, ...}, NBOOT, BOOTFUN)
 -- Function File: bootknife (DATA, NBOOT, {BOOTFUN, ...})
 -- Function File: bootknife (DATA, NBOOT, BOOTFUN, ALPHA)
 -- Function File: bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA)
 -- Function File: bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA, NPROC)
 -- Function File: bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA, NPROC, BOOTSAM)
 -- Function File: STATS = bootknife (...)
 -- Function File: [STATS, BOOTSTAT] = bootknife (...)
 -- Function File: [STATS, BOOTSTAT] = bootknife (...)
 -- Function File: [STATS, BOOTSTAT, BOOTSAM] = bootknife (...)

     'bootknife (DATA)' uses a variant of nonparametric bootstrap, called
     bootknife [1], to generate 1999 resamples from the rows of the DATA
     (column vector or matrix) and compute their means and display the
     following statistics:
        - original: the original estimate(s) calculated by BOOTFUN and the DATA
        - bias: bootstrap bias of the estimate(s)
        - std_error: bootstrap estandard error of the estimate(s)
        - CI_lower: lower bound(s) of the 95% bootstrap confidence interval
        - CI_upper: upper bound(s) of the 95% bootstrap confidence interval

     'bootknife (DATA, NBOOT)' specifies the number of bootstrap resamples,
     where NBOOT can be either:
       <> scalar: A positive integer specifying the number of bootstrap
                  resamples [2,3] for single bootstrap, or
       <> vector: A pair of positive integers defining the number of outer and
                  inner (nested) resamples for iterated (a.k.a. double)
                  bootstrap and coverage calibration [3-6].
        The default value of NBOOT is the scalar: 1999.

     'bootknife (DATA, NBOOT, BOOTFUN)' also specifies BOOTFUN: the function
     calculated on the original sample and the bootstrap resamples. BOOTFUN
     must be either a:
       <> function handle or anonymous function,
       <> string of function name, or
       <> a cell array where the first cell is one of the above function
          definitions and the remaining cells are (additional) input arguments 
          to that function (other than the data arguments).
        In all cases BOOTFUN must take DATA for the initial input argument(s).
        BOOTFUN can return a scalar or any multidimensional numeric variable,
        but the output will be reshaped as a column vector. BOOTFUN must
        calculate a statistic representative of the finite data sample; it
        should NOT be an estimate of a population parameter (unless they are
        one of the same). If BOOTFUN is @mean or 'mean', narrowness bias of
        the confidence intervals for single bootstrap are reduced by expanding
        the probabilities of the percentiles using Student's t-distribution
        [7]. By default, BOOTFUN is @mean.

     'bootknife ({D1, D2, ...}, NBOOT, BOOTFUN)' resamples from the rows of D1,
     D2 etc and the resamples are passed to BOOTFUN as multiple data input
     arguments. All data vectors and matrices (D1, D2 etc) must have the same
     number of rows.

     'bootknife (DATA, NBOOT, BOOTFUN, ALPHA)', where ALPHA is numeric and
     sets the lower and upper bounds of the confidence interval(s). The
     value(s) of ALPHA must be between 0 and 1. ALPHA can either be:
       <> scalar: To set the (nominal) central coverage of equal-tailed
                  percentile confidence intervals to 100*(1-ALPHA)%. The
                  intervals are either simple percentiles for single
                  bootstrap, or percentiles with calibrated central coverage 
                  for double bootstrap.
       <> vector: A pair of probabilities defining the (nominal) lower and
                  upper percentiles of the confidence interval(s) as
                  100*(ALPHA(1))% and 100*(ALPHA(2))% respectively. The
                  percentiles are either bias-corrected and accelerated (BCa)
                  for single bootstrap, or calibrated for double bootstrap.
        Note that the type of coverage calibration (i.e. equal-tailed or
        not) depends on whether NBOOT is a scalar or a vector. Confidence
        intervals are not calculated when the value(s) of ALPHA is/are NaN.
        The default value of ALPHA is the vector: [.025, .975], for a 95%
        confidence interval.

     'bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA)' also sets STRATA, which
     are identifiers that define the grouping of the DATA rows for stratified*
     bootstrap resampling. STRATA should be a column vector or cell array with
     the same number of rows as the DATA.

     'bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA, NPROC)' also sets the
     number of parallel processes to use to accelerate computations of double
     bootstrap, jackknife and non-vectorized function evaluations on multicore
     machines. This feature requires the Parallel package (in Octave), or the
     Parallel Computing Toolbox (in Matlab).

     'bootknife (DATA, NBOOT, BOOTFUN, ALPHA, STRATA, NPROC, BOOTSAM)' uses
     bootstrap resampling indices provided in BOOTSAM. The BOOTSAM should be a
     matrix with the same number of rows as the data. When BOOTSAM is provided,
     the first element of NBOOT is ignored.

     'STATS = bootknife (...)' returns a structure with the following fields
     (defined above): original, bias, std_error, CI_lower, CI_upper.

     '[STATS, BOOTSTAT] = bootknife (...)' returns BOOTSTAT, a vector or matrix
     of bootstrap statistics calculated over the (first, or outer layer of)
     bootstrap resamples.

     '[STATS, BOOTSTAT, BOOTSAM] = bootknife (...)' also returns BOOTSAM, the
     matrix of indices (32-bit integers) used for the (first, or outer
     layer of) bootstrap resampling. Each column in BOOTSAM corresponds
     to one bootstrap resample and contains the row indices of the values
     drawn from the nonscalar DATA argument to create that sample.

  * For cluster resampling, use the 'bootclust' function instead. Clustered
    or serially dependent data can also be analysed by the 'bootwild' and
    'bootbayes' functions.

  REQUIREMENTS:
    The function file boot.m (or better boot.mex) and bootcdf, which are
    distributed with the statistics-bootstrap package.

  DETAILS:
    For a DATA sample with n rows, bootknife resampling involves creating
  leave-one-out jackknife samples of size n - 1 and then drawing resamples
  of size n with replacement from the jackknife samples [1]. In contrast
  to bootstrap, bootknife resampling produces unbiased estimates of the
  standard error of BOOTFUN when n is small. The resampling of DATA rows
  is balanced in order to reduce Monte Carlo error, particularly for
  estimating the bias of BOOTFUN [8,9].
    For single bootstrap, the confidence intervals are constructed from the
  quantiles of a kernel density estimate of the bootstrap statistics
  (with shrinkage correction). 
    For double bootstrap, calibration is used to improve the accuracy of the 
  bias and standard error, and coverage of the confidence intervals [2-6]. 
  Double bootstrap confidence intervals are constructed from the empirical
  distribution of the bootstrap statistics by linear interpolation. 
    This function has no input arguments for specifying a random seed. However,
  one can reset the random number generator with a SEED value using following
  command:

     boot (1, 1, false, SEED);

    Please see the help documentation for the function 'boot' for more
  information about setting the seed for parallel execution of bootknife.

  BIBLIOGRAPHY:
  [1] Hesterberg T.C. (2004) Unbiasing the Bootstrap—Bootknife Sampling 
        vs. Smoothing; Proceedings of the Section on Statistics & the 
        Environment. Alexandria, VA: American Statistical Association.
  [2] Davison A.C. and Hinkley D.V (1997) Bootstrap Methods And Their 
        Application. (Cambridge University Press)
  [3] Efron, and Tibshirani (1993) An Introduction to the Bootstrap. 
        New York, NY: Chapman & Hall
  [4] Booth J. and Presnell B. (1998) Allocation of Monte Carlo Resources for
        the Iterated Bootstrap. J. Comput. Graph. Stat. 7(1):92-112 
  [5] Lee and Young (1999) The effect of Monte Carlo approximation on coverage
        error of double-bootstrap con®dence intervals. J R Statist Soc B. 
        61:353-366.
  [6] Hall, Lee and Young (2000) Importance of interpolation when
        constructing double-bootstrap confidence intervals. Journal
        of the Royal Statistical Society. Series B. 62(3): 479-491
  [7] Hesterberg, Tim (2014), What Teachers Should Know about the 
        Bootstrap: Resampling in the Undergraduate Statistics Curriculum, 
        http://arxiv.org/abs/1411.5279
  [8] Davison et al. (1986) Efficient Bootstrap Simulation.
        Biometrika, 73: 555-66
  [9] Gleason, J.R. (1988) Algorithms for Balanced Bootstrap Simulations. 
        The American Statistician. Vol. 42, No. 4 pp. 263-266

  bootknife (version 2023.07.04)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootknife (DATA)
 -- Function File: bootknife (DATA, NBOOT...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
bootlm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22822
 -- Function File: bootlm (Y, GROUP)
 -- Function File: bootlm (Y, GROUP, ..., NAME, VALUE)
 -- Function File: bootlm (Y, GROUP, ..., 'dim', DIM)
 -- Function File: bootlm (Y, GROUP, ..., 'continuous', CONTINUOUS)
 -- Function File: bootlm (Y, GROUP, ..., 'model', MODELTYPE)
 -- Function File: bootlm (Y, GROUP, ..., 'varnames', VARNAMES)
 -- Function File: bootlm (Y, GROUP, ..., 'method', METHOD)
 -- Function File: bootlm (Y, GROUP, ..., 'method', 'bayesian', 'prior', PRIOR)
 -- Function File: bootlm (Y, GROUP, ..., 'alpha', ALPHA)
 -- Function File: bootlm (Y, GROUP, ..., 'display', DISPOPT)
 -- Function File: bootlm (Y, GROUP, ..., 'contrasts', CONTRASTS)
 -- Function File: bootlm (Y, GROUP, ..., 'nboot', NBOOT)
 -- Function File: bootlm (Y, GROUP, ..., 'clustid', CLUSTID)
 -- Function File: bootlm (Y, GROUP, ..., 'blocksz', BLOCKSZ)
 -- Function File: bootlm (Y, GROUP, ..., 'posthoc', POSTHOC)
 -- Function File: bootlm (Y, GROUP, ..., 'seed', SEED)
 -- Function File: STATS = bootlm (...)
 -- Function File: [STATS, BOOTSTAT] = bootlm (...)
 -- Function File: [STATS, BOOTSTAT, AOVSTAT] = bootlm (...)
 -- Function File: [STATS, BOOTSTAT, AOVSTAT, PRED_ERR] = bootlm (...)

        Fits a linear model with categorical and/or continuous predictors (i.e.
     independent variables) on a continuous outcome (i.e. dependent variable)
     and computes the following statistics for each regression coefficient:
          - name: the name(s) of the regression coefficient(s)
          - coeff: the value of the regression coefficient(s)
          - CI_lower: lower bound(s) of the 95% confidence interval (CI)
          - CI_upper: upper bound(s) of the 95% confidence interval (CI)
          - p-val: two-tailed p-value(s) for the parameter(s) being equal to 0
        By default, confidence intervals and Null Hypothesis Significance Tests
     (NHSTs) for the regression coefficients (H0 = 0) are calculated by wild
     bootstrap-t and so are robust when normality and homoscedasticity cannot
     be assumed.

        Usage of this function is very similar to that of 'anovan'. Data (Y)
     is a single vector y with groups specified by a corresponding matrix or
     cell array of group labels GROUP, where each column of GROUP has the same
     number of rows as Y. For example, if 'Y = [1.1;1.2]; GROUP = [1,2,1; 
     1,5,2];' then observation 1.1 was measured under conditions 1,2,1 and
     observation 1.2 was measured under conditions 1,5,2. If the GROUP provided
     is empty, then the linear model is fit with just the intercept (i.e. no
     predictors).

     'bootlm' can take a number of optional parameters as name-value
     pairs.

     '[...] = bootlm (Y, GROUP, ..., 'varnames', VARNAMES)'

       <> VARNAMES must be a cell array of strings with each element
          containing a predictor name for each column of GROUP. By default
          (if not parsed as optional argument), VARNAMES are
          'X1','X2','X3', etc.

     '[...] = bootlm (Y, GROUP, ..., 'continuous', CONTINUOUS)'

       <> CONTINUOUS is a vector of indices indicating which of the
          columns (i.e. predictors) in GROUP should be treated as
          continuous predictors rather than as categorical predictors.
          The relationship between continuous predictors and the outcome
          should be linear.

     '[...] = bootlm (Y, GROUP, ..., 'model', MODELTYPE)'

       <> MODELTYPE can specified as one of the following:

             o 'linear' (default): compute N main effects with no
               interactions.

             o 'interaction': compute N effects and N*(N-1) interactions

             o 'full': compute the N main effects and interactions at
               all levels

             o a scalar integer: representing the maximum interaction
               order

             o a matrix of term definitions: each row is a term and
               each column is a predictor

               -- Example:
               A two-way design with interaction would be: [1 0; 0 1; 1 1]

     '[...] = bootlm (Y, GROUP, ..., 'method', METHOD)'

       <> METHOD can be specified as one of the following:

             o 'wild' (default): Wild bootstrap-t, using the 'bootwild'
               function. Please see the help documentation for the function
               'bootwild' for more information about this method.

             o 'bayesian': Bayesian bootstrap, using the 'bootbayes' function.
                Please see the help documentation below in the function
               'bootbayes' for more information about this method.

             Note that p-values are a frequentist concept and are only computed
             and returned from bootlm when the METHOD is 'wild'.

     '[...] = bootlm (Y, GROUP, ..., 'method', 'bayesian', 'prior', PRIOR)'

       <> Sets the prior for Bayesian bootstrap. Possible values are:

             o scalar: A positive real numeric scalar to parametrize
                  the form of the symmetric Dirichlet distribution. The
                  Dirichlet distribution is the conjugate PRIOR used to
                  randomly generate weights for linear least squares fitting
                  of the observed data and subsequently to estimate the
                  posterior for the regression coefficients by nonparametric
                  Bayesian bootstrap.

             o 'auto': Sets a value for PRIOR that effectively incorporates
                  Bessel's correction a priori such that the variance of the
                  posterior (i.e. the rows of BOOTSTAT) becomes an unbiased
                  estimator of the sampling variance*. The calculation used for
                  'auto' is as follows:
 
                     PRIOR = 1 - 2 / N
 
                  For block or cluster bootstrap, N corresponds to the number
                  of blocks or clusters (i.e. the number of independent
                  sampling units).
                       The 'auto' setting is recommended but is only available
                  for Bayesian bootstrap of the estimated marginal means and
                  for the posthoc tests (not the regression coefficients).

               The default value of PRIOR is the scalar: 1, which corresponds
               to Bayes rule: a uniform (or flat) Dirichlet distribution
               (over all points in its support). Please see the help
               documentation for the function 'bootbayes' for more information
               about the prior.

     '[...] = bootlm (Y, GROUP, ..., 'alpha', ALPHA)'

       <> ALPHA is numeric and sets the lower and upper bounds of the
          confidence or credible interval(s). The value(s) of ALPHA must be
          between 0 and 1. ALPHA can either be:

             o scalar: Set the central mass of the intervals to 100*(1-ALPHA)%.
                  For example, 0.05 for a 95% interval. If METHOD is 'wild',
                  then the intervals are symmetric bootstrap-t confidence
                  intervals. If METHOD is 'bayesian', then the intervals are
                  shortest probability credible intervals.

             o vector: A pair of probabilities defining the lower and upper
                  and upper bounds of the interval(s) as 100*(ALPHA(1))% and 
                  100*(ALPHA(2))% respectively. For example, [.025, .975] for
                  a 95% interval. If METHOD is 'wild', then the intervals are
                  asymmetric bootstrap-t confidence intervals. If METHOD is
                  'bayesian', then the intervals are simple percentile credible
                  intervals.

               The default value of ALPHA is the scalar: 0.05.

     '[...] = bootlm (Y, GROUP, ..., 'display', DISPOPT)'

       <> DISPOPT can be either 'on' (or true, default) or 'off' (or false)
          and controls the display of the model formula, a table of model
          parameter estimates and a figure of diagnostic plots. The p-values
          are formatted in APA-style.

     '[...] = bootlm (Y, GROUP, ..., 'contrasts', CONTRASTS)'

       <> CONTRASTS can be specified as one of the following:

             o A string corresponding to one of the built-in contrasts
               listed below:

                  o 'treatment' (default): Treatment contrast (or dummy)
                    coding. The intercept represents the mean of the first
                    level of all the predictors. Each slope coefficient
                    compares one level of a predictor (or interaction
                    between predictors) with the first level for that/those
                    predictor(s), at the first level of all the other
                    predictors. The first (or reference level) of the
                    predictor(s) is defined as the first level of the
                    predictor (or combination of the predictors) listed in
                    the GROUP argument. This type of contrast is ideal for
                    one-way designs or factorial designs of nominal predictor
                    variables that have an obvious reference or control group.

                  o 'anova' or 'simple': Simple (ANOVA) contrast coding. The
                    intercept represents the grand mean. Each slope coefficient
                    represents the difference between one level of a predictor
                    (or interaction between predictors) to the first level for
                    that/those predictor(s), averaged over all levels of the
                    other predictor(s). The first (or reference level) of the
                    predictor(s) is defined as the first level of the predictor
                    (or combination of the predictors) listed in the GROUP
                    argument. The columns of this contrast coding scheme sum
                    to zero. This type of contrast is ideal for nominal
                    predictor variables that have an obvious reference or
                    control group and that are modelled together with a
                    covariate or blocking factor.

                  o 'poly': Polynomial contrast coding for trend analysis.
                    The intercept represents the grand mean. The remaining
                    slope coefficients returned are for linear, quadratic,
                    cubic etc. trends across the levels. In addition to the
                    columns of this contrast coding scheme summing to zero,
                    this contrast coding is orthogonal (i.e. the off-diagonal
                    elements of its autocovariance matrix are zero) and so
                    the slope coefficients are independent. This type of
                    contrast is ideal for ordinal predictor variables, in
                    particular, predictors with ordered levels that are evenly
                    spaced.

                  o 'helmert': Helmert contrast coding. The intercept
                    represents the grand mean. Each slope coefficient
                    represents the difference between one level of a predictor
                    (or interaction between predictors) with the mean of the
                    subsequent levels, where the order of the predictor levels
                    is as they appear in the GROUP argument. In addition to the
                    columns of this contrast coding scheme summing to zero,
                    this contrast coding is orthogonal (i.e. the off-diagonal
                    elements of its autocovariance matrix are zero) and so the
                    slope coefficients are independent. This type of contrast
                    is ideal for predictor variables that are either ordinal,
                    or nominal with their levels ordered such that the contrast
                    coding reflects tests of some hypotheses of interest about
                    the nested grouping of the predictor levels.

                  o 'effect': Deviation effect coding. The intercept represents
                    the grand mean. Each slope coefficient compares one level
                    of a predictor (or interaction between predictors) with the
                    grand mean. Note that a slope coefficient is omitted for
                    the first level of the predictor(s) listed in the GROUP
                    argument. The columns of this contrast coding scheme sum to
                    zero. This type of contrast is ideal for nominal predictor
                    variables when there is no obvious reference group.

                  o 'sdif' or 'sdiff': Successive differences contrast coding.
                    The intercept represents the grand mean. Each slope
                    coefficient represents the difference between one level of
                    a predictor (or interaction between predictors) to the
                    previous one, where the order of the predictor levels is
                    as they appear in the GROUP argument. The columns of this
                    contrast coding coding scheme sum to zero. This type of
                    contrast is ideal for ordinal predictor variables.

            <> A matrix containing a custom contrast coding scheme (i.e.
               the generalized inverse of contrast weights). Rows in
               the contrast matrices correspond to predictor levels in the
               order that they first appear in the GROUP column. The
               matrix must contain the same number of columns as there
               are the number of predictor levels minus one.

          If the linear model contains more than one predictor and a
          built-in contrast coding scheme was specified, then those
          contrasts are applied to all predictors. To specify different
          contrasts for different predictors in the model, CONTRASTS should
          be a cell array with the same number of cells as there are
          columns in GROUP. Each cell should define contrasts for the
          respective column in GROUP by one of the methods described
          above. If cells are left empty, then the default contrasts
          are applied. Contrasts for cells corresponding to continuous
          predictors are ignored.

     '[...] = bootlm (Y, GROUP, ..., 'nboot', NBOOT)'

       <> Specifies the number of bootstrap resamples, where NBOOT must be a
          positive integer. If empty, the default value of NBOOT is 9999.

     '[...] = bootlm (Y, GROUP, ..., 'clustid', CLUSTID)'

       <> Specifies a vector or cell array of numbers or strings respectively
          to be used as cluster labels or identifiers. Rows of the data with
          the same CLUSTID value are treated as clusters with dependent errors.
          If empty (default), no clustered resampling is performed and all
          errors are treated as independent. The standard errors computed are
          cluster robust.

     '[...] = bootlm (Y, GROUP, ..., 'blocksz', BLOCKSZ)'

       <> Specifies a scalar, which sets the block size for bootstrapping when
          the errors have serial dependence. Rows of the data within the same
          block are treated as having dependent errors. If empty (default),
          no clustered resampling is performed and all errors are treated
          as independent. The standard errors computed are cluster robust.

     '[...] = bootlm (Y, GROUP, ..., 'dim', DIM)'

       <> DIM can be specified as one of the following:

             o a cell array of strings corresponding to variable names defined
               VARNAMES, or

             o a scalar or vector specifying the dimension(s),

          over which 'bootlm' calculates and returns estimated marginal means
          instead of regression coefficients. For example, the value [1 3]
          computes the estimated marginal mean for each combination of the
          levels of the first and third predictors. The rows of the estimates
          returned are sorted according to the order of the dimensions
          specified in DIM. The default value of DIM is empty, which makes
          'bootlm' return the statistics for the model coefficients. If DIM
          is, or includes, a continuous predictor then 'bootlm' will return an
          error. The following statistics are printed when specifying 'dim':
             - name: the name(s) of the estimated marginal mean(s)
             - mean: the estimated marginal mean(s)
             - CI_lower: lower bound(s) of the 95% confidence interval (CI)
             - CI_upper: upper bound(s) of the 95% confidence interval (CI)
             - N: the number of independent sampling units used to compute CIs

     '[...] = bootlm (Y, GROUP, ..., 'posthoc', POSTHOC)'

       <> When DIM is specified, POSTHOC comparisons along DIM can be one of
          the following:

             o 'none' (default) : No posthoc comparisons are performed. The
               statistics returned are for the estimated marginal means.

             o 'pairwise' : Pairwise comparisons are performed.

             o 'trt_vs_ctrl' : Treatment vs. Control comparisons are performed.
                Control corresponds to the level(s) of the predictor(s) listed
                within the first row of STATS when POSTHOC is set to 'none'.

             o {'trt_vs_ctrl', k} : Treatment vs. Control comparisons are
                performed. The control is group number k as returned when
                POSTHOC is set to 'none'.

          All of the posthoc comparisons use the Holm-Bonferroni procedure to
          control the type I error rate. The confidence intervals are not
          adjusted for multiple comparisons.

     '[...] = bootlm (Y, GROUP, ..., 'seed', SEED)' initialises the Mersenne
     Twister random number generator using an integer SEED value so that
     'bootlm' results are reproducible.

     'bootlm' can return up to four output arguments:

     'STATS = bootlm (...)' returns a structure with the following fields:
       - 'method': The bootstrap method
       - 'name': The names of each of the estimates
       - 'estimate': The value of the estimates
       - 'CI_lower': The lower bound(s) of the confidence/credible interval(s)
       - 'CI_upper': The upper bound(s) of the confidence/credible interval(s)
       - 'pval': The p-value(s) for the hypothesis that the estimate(s) = 0
       - 'fpr': The false positive risk 
       - 'N': The number of independnet sampling units used to compute CIs
       - 'prior': The prior used for Bayesian bootstrap
       - 'levels': A cell array with the levels of each predictor.
       - 'contrasts': A cell array of contrasts associated with each predictor.

          Note that the p-values returned are truncated at the resolution
          limit determined by the number of bootstrap replicates, specifically 
          1 / (NBOOT + 1). The following fields are only returned when
          'estimate' corresponds to the model regression coefficients:
          'levels' and 'contrasts'.

     '[STATS, BOOTSTAT] = bootlm (...)' also returns a P x NBOOT matrix of
     bootstrap statistics for the estimated parameters, where P is the number
     of parameters estimated in the model. Depending on the DIM and POSTHOC
     input arguments set by the user, the estimated parameters whose bootstrap
     statistics are returned will be either regression coefficients, the
     estimated marginal means, or the mean differences between groups of a
     categorical predictor for posthoc testing.

     '[STATS, BOOTSTAT, AOVSTAT] = bootlm (...)' also computes bootstrapped
     ANOVA statistics* and returns them in a structure with the following
     fields: 
       - 'MODEL': The formula of the linear model(s) in Wilkinson's notation
       - 'SS': Sum-of-squares
       - 'DF': Degrees of freedom
       - 'MS': Mean-squares
       - 'F': F-Statistic
       - 'PVAL': p-values
       - 'SSE': Sum-of-Squared Error
       - 'DFE': Degrees of Freedom for Error
       - 'MSE': Mean Squared Error

       The ANOVA implemented uses sequential (type I) sums-of-squares and so
       the results and their interpretation depend on the order of predictors
       in the GROUP variable (when the design is not balanced). Thus, the null
       model used for comparison for each model is the model listed directly
       above it in AOVSTAT; for the first model, the null model is the
       intercept-only model. Note that ANOVA statistics are only returned when
       the method used is wild bootstrap AND when no other statistics are
       requested (i.e. estimated marginal means or posthoc tests). The
       bootstrap is achieved by wild bootstrap of the residuals from the full
       model. Computations of the statistics in AOVSTAT are compatible with
       the 'clustid' and 'blocksz' options.

     '[STATS, BOOTSTAT, AOVSTAT, PRED_ERR] = bootlm (...)' also computes
     refined bootstrap estimates of prediction error* and returns the derived
     statistics in a structure with the following fields:
       - 'MODEL': The formula of the linear model(s) in Wilkinson's notation
       - 'PE': Bootstrap estimate of prediction error
       - 'PRESS': Bootstrap estimate of predicted residual error sum of squares
       - 'RSQ_pred': Bootstrap estimate of predicted R-squared

       The linear models evaluated are the same as for AOVSTAT, except that the 
       output also includes the statistics for the intercept-only model. Note
       that PRED_ERR statistics are only returned when the method used is wild
       bootstrap AND when no other statistics are requested (i.e. estimated
       marginal means or posthoc tests). Computations of the statistics in
       PRED_ERR are compatible with the 'clustid' and 'blocksz' options. Note
       that it is possible (and not unusual) to get a negative value for RSQ-
       pred, particularly for the intercept-only (i.e. first) model.

     * If the parallel computing toolbox (Matlab) or package (Octave) is
       installed and loaded, then these computations will be automatically
       accelerated by parallel processing on platforms with multiple processors

  bootlm (version 2023.09.01)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootlm (Y, GROUP)
 -- Function File: bootlm (Y, GROUP, ......



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bootmode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2589
 -- Function File: H = bootmode (X, M)
 -- Function File: H = bootmode (X, M, NBOOT)
 -- Function File: H = bootmode (X, M, NBOOT, KERNEL)
 -- Function File: H = bootmode (X, M, NBOOT, KERNEL, NPROC)
 -- Function File: [H, P] = bootmode (X, M, ...)
 -- Function File: [H, P, CRITVAL] = bootmode (X, M, ...)

     'H = bootmode (X, M)' tests whether the distribution underlying the 
     univariate data in vector X has M modes. The method employs the
     smooth bootstrap as described [1]. The parsimonious approach is to
     iteratively call this function, each time incrementally increasing
     the number of modes until the null hypothesis (H0) is accepted (i.e.
     H=0), where H0 corresponds to the number of modes being equal to M. 
        - If H = 0, H0 cannot be rejected at the 5% significance level.
        - If H = 1, H0 can be rejected at the 5% significance level.

     'H = bootmode (X, M, NBOOT)' sets the number of bootstrap replicates

     'H = bootmode (X, M, NBOOT, KERNEL)' sets the kernel for kernel
     density estimation. Possible values are:
        o 'Gaussian' (default)
        o 'Epanechnikov'

     'H = bootmode (X, M, NBOOT, KERNEL, NPROC)' sets the number of parallel
      processes to use to accelerate computations. This feature requires the
      Parallel package (in Octave), or the Parallel Computing Toolbox (in
      Matlab).

     '[H, P] = bootmode (X, M, ...)' also returns the p-value of the
      bootstrap test.

     '[H, P, CRITVAL] = bootmode (X, M, ...)' also returns the critical
     bandwidth (i.e.the smallest bandwidth achievable to obtain a kernel
     density estimate with M modes)

  Bibliography:
  [1] Efron and Tibshirani. Chapter 16 Hypothesis testing with the
       bootstrap in An introduction to the bootstrap (CRC Press, 1994)

  bootmode (version 2023.05.02)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: H = bootmode (X, M)
 -- Function File: H = bootmode (X, M,...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bootnhst


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7727
 -- Function File: bootnhst (DATA, GROUP)
 -- Function File: bootnhst (..., NAME, VALUE)
 -- Function File: bootnhst (..., 'bootfun', BOOTFUN)
 -- Function File: bootnhst (..., 'nboot', NBOOT)
 -- Function File: bootnhst (..., 'ref', REF)
 -- Function File: bootnhst (..., 'alpha', ALPHA)
 -- Function File: bootnhst (..., 'Options', PAROPT)
 -- Function File: PVAL = bootnhst (DATA, GROUP, ...)
 -- Function File: [PVAL, C] = bootnhst (DATA, GROUP, ...)
 -- Function File: [PVAL, C, STATS] = bootnhst (DATA, GROUP, ...)
 -- Function File: [...] = bootnhst (..., 'display', DISPLAYOPT)

     'bootnhst (DATA, GROUP)' performs a bootstrap version of a randomization
     test [1] for comparing independent samples of data in a one-way layout,
     where the categorization of the DATA values are defined by the labels in
     GROUP. DATA must be a numeric column vector or matrix, and GROUP must be
     a vector or cell array with the same number of rows as DATA. Pairwise
     posthoc tests are automatically computed by the single-step maximum t-
     statistic (maxT) procedure, which controls the family-wise error rate
     (FWER) in a manner analagous to the Tukey-Kramer Honest Significance
     Difference test. The omnibus test represents the smallest of the
     multiplicity-adjusted p-values. The results are displayed as a pretty
     table and the differences between groups are plotted along with the
     symmetic 95% bootstrap-t confidence intervals (CI). The colours of the
     markers and error bars depend on the value of the multiplicity-adjusted
     p-values: red if p < .05, or blue if p > .05. All of the p-values reported
     represent the outcome of two-tailed tests. 

     bootnhst can take a number of optional parameters as NAME-VALUE pairs:

     'bootnhst (..., 'bootfun', BOOTFUN)' also specifies BOOTFUN: the function
     calculated on the original sample and the bootstrap resamples. BOOTFUN
     must be either a:
        o function handle or anonymous function,
        o string of function name, or
        o a cell array where the first cell is one of the above function
          definitions and the remaining cells are (additional) input arguments 
          to that function (other than the data arguments).
        In all cases, BOOTFUN must take DATA for the initial input argument(s).
        BOOTFUN must calculate a statistic representative of the finite data
        sample; it should NOT be an estimate of a population parameter (unless
        they are one of the same). By default, BOOTFUN is @mean. If a robust
        alternative to the mean is required, set BOOTFUN to 'robust' to
        implement a smoothed version of the median (a.k.a. @smoothmedian). 

     'bootnhst (..., 'nboot', NBOOT)' is a scalar or a vector of upto two
     positive integers indicating the number of resamples for the first
     (bootstrap) and second (bootknife) levels of iterated resampling. If NBOOT
     is a scalar value, or if NBOOT(2) is set to 0, then standard errors are
     calculated either without resampling (if BOOTFUN @mean) or using Tukey's
     jackknife. This implementation of jackknife requires the Statistics
     package/toolbox. The default value of NBOOT is the vector: [999,99].

     'bootnhst (..., 'ref', REF)' sets the GROUP to use as the reference group
     for the post hoc tests. If REF is a recognised member of GROUP, then the
     maxT procedure for treatment versus reference controls the family-wise
     error rate (FWER) in a manner analagous to Dunnett's post hoc tests.

     'bootnhst (..., 'alpha', ALPHA)' specifies the two-tailed significance
     level for CI coverage. The default value of ALPHA is 0.05 for 95%
     confidence intervals.

     'bootnhst (..., 'Options', PAROPT)' specifies options that govern if
     and how to perform bootstrap iterations using multiple processors (if the
     Parallel Computing Toolbox or Octave Parallel package is available). This
     argument is a structure with the following recognised fields:
        o 'UseParallel':  If true, use parallel processes to accelerate
                          bootstrap computations on multicore machines,
                          specifically non-vectorized function evaluations,
                          double bootstrap resampling and jackknife function
                          evaluations. Default is false for serial computation.
                          In MATLAB, the default is true if a parallel pool
                          has already been started. 
        o 'nproc':        nproc sets the number of parallel processes

     'PVAL = bootnhst (DATA, GROUP, ...)' returns the p-value for the omnibus
     hypothesis test. Note that the p-value returned will be truncated at the
     resolution limit determined by the number of bootstrap replicates,
     specifically 1/NBOOT(1). 

     '[PVAL, C] = bootnhst (DATA, GROUP, ...)' also returns a 9 column matrix
     that summarises post hoc test results. The columns of C are:
       - column 1: reference GROUP number
       - column 2: test GROUP number
       - column 3: value of BOOTFUN evaluated for the reference GROUP
       - column 4: value of BOOTFUN evaluated for the test GROUP
       - column 5: the difference between the groups (columns 4 minus column 3)
       - column 6: t-ratio
       - column 7: multiplicity-adjusted p-value
       - column 8: LOWER bound of the 100*(1-ALPHA)% bootstrap-t CI
       - column 9: UPPER bound of the 100*(1-ALPHA)% bootstrap-t CI

     '[PVAL, C, STATS] = bootnhst (DATA, GROUP, ...)' also returns a structure 
     containing additional statistics. The stats structure contains the 
     following fields:

       gnames   - group names used in the GROUP input argument. The index of 
                  gnames corresponds to the numbers used to identify GROUPs
                  in columns 1 and 2 of the output argument c
       ref      - index of the reference group
       groups   - group index and BOOTFUN for each group with sample size,
                  standard error and CI that start to overlap at a multiplicity
                  adjusted p-value of approximately 0.05
       Var      - weighted mean (pooled) sampling variance
       maxT     - omnibus test statistic (maxT) 
       df       - degrees of freedom (if bootfun is 'mean' or 'robust')
       nboot    - number of bootstrap resamples
       alpha    - two-tailed significance level for the CI reported in c.
       bootstat - test statistic computed for each bootstrap resample 

     '[...] = bootnhst (..., 'display', DISPLAYOPT)' a logical value (true 
      or false) used to specify whether to display the results and plot the
      graph in addition to creating the output arguments. The default is true.

  BIBLIOGRAPHY:
  [1] Efron, and Tibshirani (1993) An Introduction to the Bootstrap. 
        New York, NY: Chapman & Hall

  bootnhst (version 2023.07.04)
  Bootstrap Null Hypothesis Significance Test
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootnhst (DATA, GROUP)
 -- Function File: bootnhst (..., N...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bootstrp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3376
 -- Function File: BOOTSTAT = bootstrp (NBOOT, BOOTFUN, D)
 -- Function File: BOOTSTAT = bootstrp (NBOOT, BOOTFUN, D1, ..., DN)
 -- Function File: BOOTSTAT = bootstrp (..., 'seed', SEED)
 -- Function File: BOOTSTAT = bootstrp (..., 'Options', PAROPT)
 -- Function File: [BOOTSTAT, BOOTSAM] = bootstrp (...) 

     BOOTSTAT = bootstrp (NBOOT, BOOTFUN, D) draws NBOOT bootstrap resamples
     from the data D and returns the statistic computed by BOOTFUN in BOOTSTAT
     [1]. bootstrp resamples from the rows of a data sample D (column vector
     or a matrix). BOOTFUN is a function handle (e.g. specified with @), or a
     string indicating the function name. The third input argument is data
     (column vector or a matrix), that is used to create inputs for BOOTFUN.
     The resampling method used throughout is balanced bootstrap resampling
     [2-3].

     BOOTSTAT = bootstrp (NBOOT, BOOTFUN, D1,...,DN) is as above except that 
     the third and subsequent numeric input arguments are data vectors that
     are used to create inputs for BOOTFUN.

     BOOTSTAT = bootstrp (..., 'seed', SEED) initialises the Mersenne Twister
     random number generator using an integer SEED value so that bootci results
     are reproducible.

     BOOTSTAT = bootstrp (..., 'Options', PAROPT) specifies options that govern
     if and how to perform bootstrap iterations using multiple processors (if
     the Parallel Computing Toolbox or Octave Parallel package is available).
     This argument is a structure with the following recognised fields:
        o 'UseParallel':  If true, use parallel processes to accelerate
                          bootstrap computations on multicore machines. 
                          Default is false for serial computation. In MATLAB,
                          the default is true if a parallel pool
                          has already been started. 
        o 'nproc':        nproc sets the number of parallel processes

     [BOOTSTAT, BOOTSAM] = bootstrp (...) also returns BOOTSAM, a matrix of
     indices from the bootstrap. Each column in BOOTSAM corresponds to one
     bootstrap sample and contains the row indices of the values drawn from
     the nonscalar data argument to create that sample.

  Bibliography:
  [1] Efron, and Tibshirani (1993) An Introduction to the
        Bootstrap. New York, NY: Chapman & Hall
  [2] Davison et al. (1986) Efficient Bootstrap Simulation.
        Biometrika, 73: 555-66
  [3] Booth, Hall and Wood (1993) Balanced Importance Resampling
        for the Bootstrap. The Annals of Statistics. 21(1):286-298

  bootstrp (version 2023.06.20)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: BOOTSTAT = bootstrp (NBOOT, BOOTFUN, D)
 -- Function File:...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bootwild


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6871
 -- Function File: bootwild (y)
 -- Function File: bootwild (y, X)
 -- Function File: bootwild (y, X, CLUSTID)
 -- Function File: bootwild (y, X, BLOCKSZ)
 -- Function File: bootwild (y, X, ..., NBOOT)
 -- Function File: bootwild (y, X, ..., NBOOT, ALPHA)
 -- Function File: bootwild (y, X, ..., NBOOT, ALPHA, SEED)
 -- Function File: bootwild (y, X, ..., NBOOT, ALPHA, SEED, L)
 -- Function File: STATS = bootwild (y, ...)
 -- Function File: [STATS, BOOTSTAT] = bootwild (y, ...)
 -- Function File: [STATS, BOOTSTAT, BOOTSSE] = bootwild (y, ...)

     'bootwild (y)' performs a null hypothesis significance test for the
     mean of y being equal to 0. This function implements wild bootstrap-t
     resampling of Webb's 6-point distribution of the residuals, and computes
     p-values after imposing the null hypothesis (H0) [1-4]. The following
     statistics are printed to the standard output:
        - original: the mean of the data vector y
        - std_err: heteroscedasticity-consistent standard error(s)
        - CI_lower: lower bound(s) of the 95% bootstrap-t confidence interval
        - CI_upper: upper bound(s) of the 95% bootstrap-t confidence interval
        - tstat: Student's t-statistic
        - pval: two-tailed p-value(s) for the parameter(s) being equal to 0
        - fpr: minimum false positive risk for the corresponding p-value
          By default, the confidence intervals are symmetric, two-sided
          bootstrap-t confidence intervals. The p-values are computed
          following both of the guidelines by Hall and Wilson [5]. The minimum
          false positive risk (FPR) is computed according to the Sellke-Berger
          approach as described in [6,7].

     'bootwild (y, X)' also specifies the design matrix (X) for least squares
     regression of y on X. X should be a column vector or matrix the same
     number of rows as y. If the X input argument is empty, the default for X
     is a column of ones (i.e. intercept only) and thus the statistic computed
     reduces to the mean (as above). The statistics calculated and returned in
     the output then relate to the coefficients from the regression of y on X.

     'bootwild (y, X, CLUSTID)' specifies a vector or cell array of numbers
     or strings respectively to be used as cluster labels or identifiers.
     Rows in y (and X) with the same CLUSTID value are treated as clusters
     with dependent errors. Rows of y (and X) assigned to a particular
     cluster will have identical resampling during wild bootstrap. If empty
     (default), no clustered resampling is performed and all errors are
     treated as independent. The standard errors computed are cluster robust.

     'bootwild (y, X, BLOCKSZ)' specifies a scalar, which sets the block size
     for bootstrapping when the residuals have serial dependence. Identical
     resampling occurs within each (consecutive) block of length BLOCKSZ
     during wild bootstrap. Rows of y (and X) within the same block are
     treated as having dependent errors. If empty (default), no block
     resampling is performed and all errors are treated as independent.
     The standard errors computed are cluster robust.

     'bootwild (y, X, ..., NBOOT)' specifies the number of bootstrap resamples,
     where NBOOT must be a positive integer. If empty, the default value of
     NBOOT is 1999.

     'bootwild (y, X, ..., NBOOT, ALPHA)' is numeric and sets the lower and
     upper bounds of the confidence interval(s). The value(s) of ALPHA must
     be between 0 and 1. ALPHA can either be:
        o scalar: To set the (nominal) central coverage of SYMMETRIC
                  bootstrap-t confidence interval(s) to 100*(1-ALPHA)%.
                  For example, 0.05 for a 95% confidence interval.
        o vector: A pair of probabilities defining the (nominal) lower and
                  upper bounds of ASYMMETRIC bootstrap-t confidence interval(s)
                  as 100*(ALPHA(1))% and 100*(ALPHA(2))% respectively. For
                  example, [.025, .975] for a 95% confidence interval.
        The default value of ALPHA is the scalar: 0.05, for a symmetric 95%
        bootstrap-t confidence interval.

     'bootwild (y, X, ..., NBOOT, ALPHA, SEED)' initialises the Mersenne
     Twister random number generator using an integer SEED value so that
     'bootwild' results are reproducible.

     'bootwild (y, X, ..., NBOOT, ALPHA, SEED, L)' multiplies the regression
     coefficients by the hypothesis matrix L. If L is not provided or is empty,
     it will assume the default value of 1 (i.e. no change to the design). 

     'STATS = bootwild (...) returns a structure with the following fields:
     original, std_err, CI_lower, CI_upper, tstat, pval, fpr and the sum-of-
     squared error (sse).

     '[STATS, BOOTSTAT] = bootwild (...)  also returns a vector (or matrix) of
     bootstrap statistics (BOOTSTAT) calculated over the bootstrap resamples
     (before studentization).

     '[STATS, BOOTSTAT, BOOTSSE] = bootwild (...)  also returns a vector
     containing the sum-of-squared error for the fit on each bootstrap 
     resample.

  Bibliography:
  [1] Wu (1986). Jackknife, bootstrap and other resampling methods in
        regression analysis (with discussions). Ann Stat.. 14: 1261–1350. 
  [2] Cameron, Gelbach and Miller (2008) Bootstrap-based Improvements for
        Inference with Clustered Errors. Rev Econ Stat. 90(3), 414-427
  [3] Webb (2023) Reworking wild bootstrap-based inference for clustered
        errors. Can J Econ. https://doi.org/10.1111/caje.12661
  [4] Cameron and Miller (2015) A Practitioner’s Guide to Cluster-Robust
        Inference. J Hum Resour. 50(2):317-372
  [5] Hall and Wilson (1991) Two Guidelines for Bootstrap Hypothesis Testing.
        Biometrics, 47(2), 757-762
  [6] Colquhoun (2019) The False Positive Risk: A Proposal Concerning What
        to Do About p-Values, Am Stat. 73:sup1, 192-201
  [7] Sellke, Bayarri and Berger (2001) Calibration of p-values for Testing
        Precise Null Hypotheses. Am Stat. 55(1), 62-71

  bootwild (version 2023.07.05)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: bootwild (y)
 -- Function File: bootwild (y, X)
 -- Functi...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
credint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2300
 -- Function File: CI = credint (Y)
 -- Function File: CI = credint (Y, PROB)

     'CI = credint (Y)' computes 95% credible intervals of data in the vector,
     or rows* of the matrix, Y. The credible intervals are shortest probability
     intervals (SPI), which represent a more computationally stable version of
     the highest posterior density interval [1,2].

        * The matrix should have dimensions P * NBOOT, where P corresponds to
          the number of parameter estimates and NBOOT corresponds to the number
          of posterior (or Bayesian bootstrap) samples.

     'CI = credint (Y, PROB)' returns credible intervals, where PROB is numeric
     and sets the lower and upper bounds of the credible interval(s). The
     value(s) of PROB must be between 0 and 1. PROB can either be:
       <> scalar: To set the central mass of shortest probability intervals
                  to 100*(1-PROB)%
       <> vector: A pair of probabilities defining the lower and upper
                  percentiles of the credible interval(s) as 100*(PROB(1))%
                  and 100*(PROB(2))% respectively. 
          The default value of PROB is the scalar: 0.95, for a 95% shortest 
          posterior credible interval.

  Bibliography:
  [1] Liu, Gelman & Zheng (2015). Simulation-efficient shortest probability
        intervals. Statistics and Computing, 25(4), 809–819. 
  [2] Gelman (2020) Shortest Posterior Intervals.
        https://discourse.mc-stan.org/t/shortest-posterior-intervals/16281/16

  credint (version 2023.09.03)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
 -- Function File: CI = credint (Y)
 -- Function File: CI = credint (Y, PROB)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
deffcalc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1547
 -- Function File: DEFF = deffcalc (BOOTSTAT, BOOTSTAT_SRS)

     'DEFF = deff_calc (BOOTSTAT, BOOTSTAT_SRS)' computes the design effect
     (DEFF) by taking the ratio of the variance of the bootstrap statistics
     from a complex design over the variance of bootstrap statistics from
     simple random sampling with replacement:

            DEFF = var (BOOTSTAT, 0, 2) ./ var (BOOTSTAT_SRS, 0, 2);

     BOOTSTAT and BOOTSTAT_SRS must be row vectors, or matrices with dimenions
     of size P * NBOOT, where P is the number of parameters being estimated
     and NBOOT is the number of bootstrap statistics. The number of parameters
     being estimated (but not the number of bootstrap resamples) must be the
     same to compute DEFF using this function.

  deffcalc (version 2023.09.17)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
 -- Function File: DEFF = deffcalc (BOOTSTAT, BOOTSTAT_SRS)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
randtest2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5298
 -- Function File: PVAL = randtest2 (X, Y)
 -- Function File: PVAL = randtest2 (X, Y, PAIRED)
 -- Function File: PVAL = randtest2 (X, Y, PAIRED, NREPS)
 -- Function File: PVAL = randtest2 (X, Y, PAIRED, NREPS)
 -- Function File: PVAL = randtest2 (X, Y, PAIRED, NREPS, FUNC)
 -- Function File: PVAL = randtest2 (X, Y, PAIRED, NREPS, FUNC, SEED)
 -- Function File: PVAL = randtest2 ([X, GX], [Y, GY], ...)
 -- Function File: [PVAL, STAT] = randtest (...)
 -- Function File: [PVAL, STAT, PERMSTATS] = randtest (...)

     'PVAL = randtest2 (X, Y)' performs a randomization (a.k.a. permutation)
     test to ascertain whether data samples X and Y come from populations with
     the same distribution. Distributions are compared using the Wasserstein
     metric [1,2], which is the area of the difference between the empirical
     cumulative distribution functions of X and Y. The data in X and Y should
     be column vectors that represent measurements of the same variable. The
     value returned is a 2-tailed p-value against the null hypothesis computed
     using the absolute values of the test statistics.

     'PVAL = randtest2 (X, Y, PAIRED)' specifies whether X and Y should be
     treated as independent (unpaired) or paired samples. PAIRED accepts a
     logical scalar:
        o false (default): As above.
        o true: Performs a randomization or permutation test to ascertain
                whether paired or matched data samples X and Y come from
                populations with the same distribution. The vectors X and Y
                must contain the same number of sampling units.

     'PVAL = randtest2 (X, Y, PAIRED, NREPS)' specifies the number of resamples
     without replacement to take in the randomization test. By default, NREPS
     is 5000. If the number of possible permutations is smaller than NREPS, the
     test becomes exact. For example, if the number of sampling units across
     two independent samples is 6, then the number of possible permutations is
     factorial (6) = 720, so NREPS will be truncated at 720 and sampling will
     systematically evaluate all possible permutations. If the number of
     sampling units in each paired sample is 12, then the number of possible
     permutations is 2^12 = 4096, so NREPS will be truncated at 4096 and
     sampling will systematically evaluate all possible permutations. 

     'PVAL = randtest2 (X, Y, PAIRED, NREPS, FUNC)' also specifies a custom
     function calculated on the original samples, and the permuted or
     randomized resamples. Note that FUNC must compute a difference statistic
     between samples X and Y, and should either be a:
        o function handle or anonymous function,
        o string of function name, or
        o a cell array where the first cell is one of the above function
          definitions and the remaining cells are (additional) input arguments 
          to that function (other than the data arguments).
!       See the built-in demos for example usage with the mean or vaiance.

     'PVAL = randtest2 (X, Y, PAIRED, NREPS, FUNC, SEED)' initialises the
     Mersenne Twister random number generator using an integer SEED value so
     that that the results of 'randtest2' results are reproducible when the
     test is approximate (i.e. when using randomization if not all permutations
     can be evaluated systematically).

     'PVAL = randtest2 ([X, GX], [Y, GY], ...)' also specifies the sampling
     units (i.e. clusters) using consecutive positive integers in GX and GY
     for X and Y respectively. If PAIRED is false, numeric identifiers in
     GX and GY must be unique (e.g. 1,2,3 in GX, 4,5,6 in GY). If PAIRED is
     true,  numeric identifiers in GX and GY must by identical (e.g. 1,2,3 in
     GX, 1,2,3 in GY). Note that when sampling units contain different numbers
     of values, function evaluations after sampling cannot be vectorized. If
     the parallel computing toolbox (Matlab) or package (Octave) is installed
     and loaded, then the function evaluations will be automatically
     accelerated by parallel processing on platforms with multiple processors.

     '[PVAL, STAT] = randtest2 (...)' also returns the test statistic.

     '[PVAL, STAT, PERMSTATS] = randtest2 (...)' also returns the statistics
     of the permutation distribution.

  Bibliography:
  [1] Dowd (2020) A New ECDF Two-Sample Test Statistic. arXiv.
       https://doi.org/10.48550/arXiv.2007.01360
  [2] https://en.wikipedia.org/wiki/Wasserstein_metric

  randtest2 (version 2023.09.16)
  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: PVAL = randtest2 (X, Y)
 -- Function File: PVAL = randtest...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
sampszcalc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3482
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ)
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW)
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA)
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA, TAILS)
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA, TAILS, DEFF)

      Perform sample size calculations by power analysis. 

      'N = sampszcalc (TESTTYPE, EFFSZ)' returns the required sample size to
      reach the significance level (alpha) of 0.05 in a two-tailed version of
      the test specified in TESTTYPE for the specified effect size, EFFSZ,
      with a power of 0.8 (i.e. a type II error rate of 1 - 0.8 = 0.2)

        TESTTYPE can be:

          't2' (default) : two-sample unpaired t-test

          't' : paired t-test or one-sample t-test

          'z2' (default) : two-sample unpaired z-test (Normal approximation)

          'z' : paired z-test or one-sample z-test (Normal approximation)

          'r' : significance test for correlation

        EFFSZ can be numeric value corresponding to the standardized effect
        size: Cohen's d or h (when TESTTYPE is 't2', 't', 'z' or 'z'), or 
        Pearson's correlation coefficient (when TESTTYPE is 'r'). For
        convenience, EFFSZ can also be one of the following strings:

          'small' : which is 0.2 for Cohen's d (or h), or 0.1 for Pearson's r.

          'medium' : which is 0.5 for Cohen's d (or h), or 0.3 for Pearson's r.

          'large' : which is 0.8 for Cohen's d (or h), or 0.5 for Pearson's r.

       'N = sampszcalc (TESTTYPE, EFFSZ, POW)' also sets the desired power of
       the test. The power corresponds to 1 - beta, where beta is the type II
       error rate (i.e. the probability of not rejecting the null hypothesis
       when it is actually false). (Default is 0.8)

       'N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA)' also sets the desired
       significance level, ALPHA, of the test. ALPHA corresponds to the type I
       error rate (i.e. the probability of rejecting the null hypothesis when
       it is actually true). (Default is 0.05)

       HINT: If the test is expected to be among a family of tests, divide
       ALPHA by the number of tests so that the sample size calculations will
       maintain the desired power after correction for multiple comparisons.

       'N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA, TAILS)' also sets whether
       the test is one-sided or two-sided. (Default is 2)

       'N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA, TAILS, DEFF)' also sets
       the design effect to correct the sample size calculation. (Default is 1)
       DEFF can be estimated by dividing the sampling variance of the parameter
       of interest from a complex experimental design by the equivalent
       statistic computed using simple random sampling with replacement.

  Author: Andrew Charles Penn
  https://www.researchgate.net/profile/Andrew_Penn/

  Copyright 2019 Andrew Charles Penn
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 -- Function File: N = sampszcalc (TESTTYPE, EFFSZ)
 -- Function File: N = sa...





