diff --git a/docs/copying.html b/docs/copying.html
index ef90bcf5..b906abb1 100644
--- a/docs/copying.html
+++ b/docs/copying.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/description.json b/docs/description.json
index 629e95b4..7af99553 100644
--- a/docs/description.json
+++ b/docs/description.json
@@ -1,7 +1,7 @@
{
"generator": "generate_html",
"generator_version": "0.3.3",
- "date_generated": "2024-01-07",
+ "date_generated": "2024-01-08",
"package":
{
"name": "statistics-resampling",
diff --git a/docs/function/boot.html b/docs/function/boot.html
index 302636a6..bc2d1b93 100644
--- a/docs/function/boot.html
+++ b/docs/function/boot.html
@@ -3,7 +3,7 @@
-
+
@@ -115,9 +115,17 @@ Demonstration 1
Produces the following output
ans =
- 2 2 3 3 1 1 2 2 3 2 2 3 3 1 3 2 1 2 3 1
- 2 3 3 2 1 1 1 2 3 3 3 1 1 2 3 3 2 1 1 2
- 3 2 3 3 2 2 2 1 3 3 1 1 1 1 2 1 2 1 3 1
+ Columns 1 through 12:
+
+ 3 3 1 2 1 3 2 3 2 1 1 3
+ 3 3 1 2 1 1 1 2 3 1 1 2
+ 3 2 2 3 2 2 2 1 3 1 2 3
+
+ Columns 13 through 20:
+
+ 2 1 3 3 2 2 2 3
+ 1 2 3 3 1 1 3 1
+ 2 3 2 1 1 1 3 2
Demonstration 2
@@ -129,9 +137,17 @@
Demonstration 2
Produces the following output
ans =
- 3 3 2 3 1 2 2 1 1 3 3 1 2 3 2 2 1 2 2 3
- 2 1 1 2 1 1 3 1 1 3 3 2 3 1 1 3 1 2 2 2
- 2 3 1 3 3 2 3 1 1 3 3 1 3 3 1 2 1 2 2 2
+ Columns 1 through 12:
+
+ 3 3 1 3 3 2 2 1 1 2 1 1
+ 2 1 2 3 3 2 3 3 1 3 1 1
+ 3 3 1 2 1 2 2 1 1 2 3 2
+
+ Columns 13 through 20:
+
+ 3 3 1 3 1 2 2 1
+ 3 3 2 3 1 2 2 1
+ 2 1 2 2 3 2 3 1
Demonstration 3
@@ -145,21 +161,45 @@
Demonstration 3
Produces the following output
ans =
- 3 3 3 3 1 2 3 3 1 1 2 2 1 2 2 2 1 2 1 1
- 3 1 2 2 3 1 3 1 2 2 3 3 2 3 3 3 3 1 1 2
- 3 2 3 1 3 1 1 1 3 1 2 3 2 1 2 2 2 1 2 1
+ Columns 1 through 12:
+
+ 3 3 3 3 1 2 3 3 1 1 2 2
+ 3 1 2 2 3 1 3 1 2 2 3 3
+ 3 2 3 1 3 1 1 1 3 1 2 3
+
+ Columns 13 through 20:
+
+ 1 2 2 2 1 2 1 1
+ 2 3 3 3 3 1 1 2
+ 2 1 2 2 2 1 2 1
ans =
- 3 3 3 3 1 2 3 3 1 1 2 2 1 2 2 2 1 2 1 1
- 3 1 2 2 3 1 3 1 2 2 3 3 2 3 3 3 3 1 1 2
- 3 2 3 1 3 1 1 1 3 1 2 3 2 1 2 2 2 1 2 1
+ Columns 1 through 12:
+
+ 3 3 3 3 1 2 3 3 1 1 2 2
+ 3 1 2 2 3 1 3 1 2 2 3 3
+ 3 2 3 1 3 1 1 1 3 1 2 3
+
+ Columns 13 through 20:
+
+ 1 2 2 2 1 2 1 1
+ 2 3 3 3 3 1 1 2
+ 2 1 2 2 2 1 2 1
ans =
- 3 2 2 3 2 3 1 2 2 3 1 2 3 1 2 3 2 3 2 3
- 1 3 1 1 2 3 3 3 1 2 1 1 2 1 3 1 1 3 3 2
- 1 3 3 1 1 1 2 3 2 2 2 1 2 3 3 1 1 2 2 1
+ Columns 1 through 12:
+
+ 3 2 2 3 2 3 1 2 2 3 1 2
+ 1 3 1 1 2 3 3 3 1 2 1 1
+ 1 3 3 1 1 1 2 3 2 2 2 1
+
+ Columns 13 through 20:
+
+ 3 1 2 3 2 3 2 3
+ 2 1 3 1 1 3 3 2
+ 2 3 3 1 1 2 2 1
Demonstration 4
@@ -172,15 +212,15 @@
Demonstration 4
Produces the following output
ans =
- 44 23 23 36 44 23 44 36 36 23
- 36 23 36 23 44 36 36 23 44 44
- 36 36 23 44 23 44 23 36 44 44
+ 44 23 23 36 44 23 44 36 36 23
+ 36 23 36 23 44 36 36 23 44 44
+ 36 36 23 44 23 44 23 36 44 44
ans =
- 23 23 23 36 23 23 23 36 36 23
- 36 23 36 23 23 36 36 23 23 23
- 36 36 23 23 23 23 23 36 23 23
+ 23 23 23 36 23 23 23 36 36 23
+ 36 23 36 23 23 36 36 23 23 23
+ 36 36 23 23 23 23 23 36 23 23
Demonstration 5
@@ -194,30 +234,30 @@
Demonstration 5
Produces the following output
ans =
- 4
- 2
- 3
- 5
- 4
- 6
+ 4
+ 2
+ 3
+ 5
+ 4
+ 6
ans =
- 4
- 3
- 4
- 6
- 6
- 2
+ 4
+ 3
+ 4
+ 6
+ 6
+ 2
ans =
- 5
- 6
- 3
- 4
- 1
- 6
+ 5
+ 6
+ 3
+ 4
+ 1
+ 6
Package: statistics-resampling
diff --git a/docs/function/boot1way.html b/docs/function/boot1way.html
index 65765651..40e3c0f5 100644
--- a/docs/function/boot1way.html
+++ b/docs/function/boot1way.html
@@ -3,7 +3,7 @@
-
+
@@ -473,7 +473,7 @@ Demonstration 6
-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
-| 1 | 2 | 1 | +0.2799 | +0.54 | .628 |
+| 1 | 2 | 1 | +0.1206 | +0.21 | .820 |
-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
@@ -518,7 +518,7 @@ Demonstration 7
-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
-| 1 | 2 | 1 | +0.2132 | +0.33 | .620 |
+| 1 | 2 | 1 | +0.2364 | +0.42 | .547 |
-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
diff --git a/docs/function/bootbayes.html b/docs/function/bootbayes.html
index ecac863a..0fc74200 100644
--- a/docs/function/bootbayes.html
+++ b/docs/function/bootbayes.html
@@ -3,7 +3,7 @@
-
+
@@ -186,7 +186,7 @@ Demonstration 1
Posterior Statistics:
original bias median stdev CI_lower CI_upper
- +184.5 +0.01393 +184.5 1.309 +181.9 +187.2
+ +184.5 +0.01529 +184.5 1.351 +181.7 +187.2
Demonstration 2
@@ -222,8 +222,8 @@
Demonstration 2
Posterior Statistics:
original bias median stdev CI_lower CI_upper
- +175.5 -0.03600 +175.5 2.421 +170.7 +180.0
- +0.1904 -0.0005078 +0.1928 0.08075 +0.02605 +0.3399
+ +175.5 -0.07775 +175.4 2.287 +171.1 +179.9
+ +0.1904 +0.002169 +0.1929 0.07622 +0.03454 +0.3340
Package: statistics-resampling
diff --git a/docs/function/bootcdf.html b/docs/function/bootcdf.html
index bc4e0395..37fb1304 100644
--- a/docs/function/bootcdf.html
+++ b/docs/function/bootcdf.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/bootci.html b/docs/function/bootci.html
index 47cbcd39..2b22b608 100644
--- a/docs/function/bootci.html
+++ b/docs/function/bootci.html
@@ -3,7 +3,7 @@
-
+
@@ -183,8 +183,8 @@ Demonstration 1
Produces the following output
ci =
- 23.825
- 34.411
+ 23.825
+ 34.411
Demonstration 2
@@ -202,8 +202,8 @@
Demonstration 2
Produces the following output
ci =
- 23.462
- 34.651
+ 23.462
+ 34.651
Demonstration 3
@@ -222,8 +222,8 @@
Demonstration 3
Produces the following output
ci =
- 24.811
- 36.698
+ 24.811
+ 36.698
Demonstration 4
@@ -239,8 +239,8 @@
Demonstration 4
Produces the following output
ci =
- 100.29
- 233.90
+ 100.29
+ 233.9
Demonstration 5
@@ -256,8 +256,8 @@
Demonstration 5
Produces the following output
ci =
- 116.40
- 265.89
+ 116.4
+ 265.89
Demonstration 6
@@ -276,8 +276,8 @@
Demonstration 6
Produces the following output
ci =
- 106.75
- 290.95
+ 106.75
+ 290.95
Demonstration 7
@@ -296,8 +296,8 @@
Demonstration 7
Produces the following output
ci =
- 115.81
- 278.35
+ 115.81
+ 278.35
Demonstration 8
@@ -317,12 +317,104 @@
Demonstration 8
Produces the following output
ci =
- 0.5167
- 0.8730
+ 0.51674
+ 0.873
Demonstration 9
The following code
+
+
+ ## Calculating confidence intervals for the coefficients from multinomial
+ ## regression with ordinal responses using the example from:
+ ## https://uk.mathworks.com/help/stats/mnrfit.html
+
+ ##>>>>>>>>> This code block must be run first in Octave only >>>>>>>>>>>>
+ try
+ pkg load statistics
+ load carbig
+ # Octave Statistics package does not currently have the mnrfit function, so
+ # we will use it's logistic_regression function for fitting ordinal models
+ # instead.
+ function [B, DEV] = mnrfit (X, Y, varargin)
+ # Note that the logistic_regression function is only suitable when
+ # the outcome is ordinal, so we would need to use append 'model',
+ # 'ordinal' as a name-value pair in MATLAB when executing it's
+ # mnrfit function (see below)
+ [INTERCEPT, SLOPE, DEV] = logistic_regression (Y - 1, X, false);
+ B = cat (1, INTERCEPT, SLOPE);
+ end
+ stats_pkg = true;
+ catch
+ stats_pkg = false;
+ fprintf ('\nSkipping this demo...')
+ fprintf ('\nRequired feaures of the statistics package not found.\n\n');
+ end
+ ##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ if (stats_pkg)
+
+ ##>>>>>>>>>>>>>>>>>>> This code block is the demo >>>>>>>>>>>>>>>>>>>>>>
+
+ ## Create the dataset
+ load carbig
+ X = [Acceleration Displacement Horsepower Weight];
+
+ ## The responses 1 - 4 correspond to the following classification:
+ ## 1: 9 - 19 miles per gallon
+ ## 2: 19 - 29 miles per gallon
+ ## 3: 29 - 39 miles per gallon
+ ## 4: 39 - 49 miles per gallon
+ miles = [1,1,1,1,1,1,1,1,1,1,NaN,NaN,NaN,NaN,NaN,1,1,NaN,1,1,2,2,1,2, ...
+ 2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,NaN,2,1,1,2,1,1,1,1,1,1,1,1,1, ...
+ 2,2,1,2,2,3,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1, ...
+ 1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1, ...
+ 1,1,2,2,2,1,2,2,2,1,1,3,2,2,2,1,2,2,1,2,2,2,1,3,2,3,2,1,1,1, ...
+ 1,1,1,1,1,3,2,2,3,3,2,2,2,2,2,3,2,1,1,1,1,1,1,1,1,1,1,1,2,2, ...
+ 1,3,2,2,2,2,2,2,1,3,2,2,2,2,2,3,2,2,2,2,2,1,1,1,1,2,2,2,2,3, ...
+ 2,3,3,2,1,1,1,3,3,2,2,2,1,2,2,1,1,1,1,1,3,3,3,2,3,1,1,1,1,1, ...
+ 2,2,1,1,1,1,1,3,2,2,2,3,3,3,3,2,2,2,4,3,3,4,3,2,2,2,2,2,2,2, ...
+ 2,2,2,2,1,1,2,1,1,1,3,2,2,3,2,2,2,2,2,1,2,1,3,3,2,2,2,2,2,1, ...
+ 1,1,1,1,1,2,1,3,3,3,2,2,2,2,2,3,3,3,3,2,2,2,3,4,3,3,3,2,2,2, ...
+ 2,3,3,3,3,3,4,2,4,4,4,3,3,4,4,3,3,3,2,3,2,3,2,2,2,2,3,4,4,3, ...
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,2,NaN,3,2,2,2,2,2,1,2,2,3,3,3,2,2, ...
+ 2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,3,2,2,4,3,2,3]';
+
+ ## Model coefficients from logistic regression
+ B = mnrfit (X, miles, 'model', 'ordinal');
+
+ ## Bootsrap confidence intervals for each logistic regression coefficient
+ ci = bootci (1999, @(X, miles) mnrfit (X, miles, 'model', 'ordinal'), ...
+ X, miles);
+ [B, ci']
+
+ ## Where the first three rows are the intercept terms, and the last 4 rows
+ ## are the slope coefficients. For each predictor, the slope coefficient
+ ## corresponds to how a unit change in the predictor impacts on the odds
+ ## across the (ordered) catagories, where each log-odds is:
+ ##
+ ## ln ((P below) / (P above))
+ ##
+ ## Therefore, a positive slope value indicates that a unit increase in the
+ ## predictor increases the odds of running at fewer miles per gallon.
+
+ ##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ end
+
Produces the following output
+
ans =
+
+ -16.69 -20.526 -12.642
+ -11.721 -15.188 -8.0851
+ -8.0606 -11.299 -4.6596
+ 0.10476 -0.062295 0.28823
+ 0.010336 -0.00273 0.023016
+ 0.06452 0.033493 0.094721
+ 0.0016638 0.00019837 0.0031828
+
+Demonstration 10
+
+
The following code
## Spatial Test Data from Table 14.1 of Efron and Tibshirani (1993)
diff --git a/docs/function/bootclust.html b/docs/function/bootclust.html
index e361c7b3..ec645f6e 100644
--- a/docs/function/bootclust.html
+++ b/docs/function/bootclust.html
@@ -3,7 +3,7 @@
-
+
@@ -169,11 +169,11 @@ Demonstration 1
Resampling method: Balanced, bootstrap cluster resampling
Number of resamples: 1999
Confidence interval (CI) type: Expanded bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 95% (1.2%, 97.5%)
+ Nominal coverage (and the percentiles used): 95% (1.3%, 97.6%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +29.65 -7.105e-15 +2.599 +23.56 +34.62
+ +29.65 -1.776e-14 +2.525 +23.89 +34.65
Demonstration 2
@@ -198,11 +198,11 @@
Demonstration 2
Resampling method: Balanced, bootstrap cluster resampling
Number of resamples: 1999
Confidence interval (CI) type: Expanded bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 95% (1.3%, 99.0%)
+ Nominal coverage (and the percentiles used): 95% (1.1%, 98.8%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +29.65 -0.03609 +2.885 +23.15 +35.90
+ +29.65 -0.02622 +2.914 +22.94 +36.13
Demonstration 3
@@ -229,7 +229,7 @@
Demonstration 3
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -6.512 +41.58 +98.70 +235.5
+ +171.5 -6.758 +42.69 +95.86 +235.5
Demonstration 4
@@ -258,7 +258,7 @@
Demonstration 4
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -9.285 +33.61 +104.5 +215.2
+ +171.5 -9.106 +33.87 +103.6 +215.3
Demonstration 5
@@ -280,11 +280,11 @@
Demonstration 5
Resampling method: Balanced, bootstrap cluster resampling
Number of resamples: 1999
Confidence interval (CI) type: Bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 90% (13.5%, 99.0%)
+ Nominal coverage (and the percentiles used): 90% (12.6%, 98.8%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -7.015 +42.52 +117.4 +266.7
+ +171.5 -6.269 +41.18 +118.5 +261.3
Demonstration 6
@@ -308,11 +308,11 @@
Demonstration 6
Resampling method: Balanced, bootstrap cluster resampling
Number of resamples: 1999
Confidence interval (CI) type: Bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 90% (11.9%, 98.5%)
+ Nominal coverage (and the percentiles used): 90% (14.2%, 98.9%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -9.338 +33.31 +121.7 +228.2
+ +171.5 -9.540 +34.39 +124.2 +234.4
Demonstration 7
@@ -337,8 +337,8 @@
Demonstration 7
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +0.005392 +0.02096 +0.2672 -0.4675 +0.4154
- -0.1459 -0.07730 +0.3883 -0.7714 +0.4478
+ -0.2145 +0.005866 +0.2161 -0.5736 +0.1393
+ +0.3399 +0.006693 +0.1491 +0.09370 +0.5845
Demonstration 8
@@ -364,8 +364,8 @@
Demonstration 8
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +0.1623 -0.02809 +0.1560 -0.06140 +0.4708
- +0.1405 +0.01761 +0.1529 -0.1759 +0.3341
+ -0.07936 +0.008087 +0.1608 -0.3296 +0.2014
+ +0.1572 +0.03360 +0.1299 -0.02060 +0.3576
Demonstration 9
@@ -391,11 +391,11 @@
Demonstration 9
Resampling method: Balanced, bootstrap cluster resampling
Number of resamples: 1999
Confidence interval (CI) type: Bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 95% (1.6%, 96.5%)
+ Nominal coverage (and the percentiles used): 95% (1.8%, 96.8%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +0.7764 -0.02432 +0.1463 +0.3810 +0.9934
+ +0.7764 -0.02311 +0.1403 +0.4088 +0.9907
Package: statistics-resampling
diff --git a/docs/function/bootknife.html b/docs/function/bootknife.html
index d064babf..a6914061 100644
--- a/docs/function/bootknife.html
+++ b/docs/function/bootknife.html
@@ -3,7 +3,7 @@
-
+
@@ -222,11 +222,11 @@ Demonstration 1
Number of resamples (outer): 1999
Number of resamples (inner): 0
Confidence interval (CI) type: Expanded bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 95% (1.2%, 97.0%)
+ Nominal coverage (and the percentiles used): 95% (1.3%, 97.2%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +29.65 +2.842e-14 +2.589 +23.77 +34.39
+ +29.65 -2.487e-14 +2.599 +23.93 +34.50
Demonstration 2
@@ -251,11 +251,11 @@
Demonstration 2
Number of resamples (outer): 1999
Number of resamples (inner): 199
Confidence interval (CI) type: Calibrated percentile
- Nominal coverage (and the percentiles used): 95% (1.2%, 97.6%)
+ Nominal coverage (and the percentiles used): 95% (1.2%, 97.5%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +29.65 +4.263e-14 +2.631 +23.19 +34.73
+ +29.65 -2.842e-14 +2.681 +23.29 +34.51
Demonstration 3
@@ -281,11 +281,11 @@
Demonstration 3
Number of resamples (outer): 1999
Number of resamples (inner): 199
Confidence interval (CI) type: Calibrated percentile
- Nominal coverage (and the percentiles used): 95% (2.9%, 98.1%)
+ Nominal coverage (and the percentiles used): 95% (1.8%, 97.8%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +30.86 -0.01663 +2.865 +24.86 +36.80
+ +30.86 -0.01582 +3.084 +24.62 +36.92
Demonstration 4
@@ -313,7 +313,7 @@
Demonstration 4
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -6.869 +41.81 +96.39 +235.4
+ +171.5 -6.799 +42.70 +97.51 +238.0
Demonstration 5
@@ -340,7 +340,7 @@
Demonstration 5
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -7.065 +43.05 +112.5 +263.2
+ +171.5 -6.948 +42.58 +113.2 +258.6
Demonstration 6
@@ -366,11 +366,11 @@
Demonstration 6
Number of resamples (outer): 1999
Number of resamples (inner): 199
Confidence interval (CI) type: Calibrated percentile (equal-tailed)
- Nominal coverage (and the percentiles used): 90% (2.7%, 97.3%)
+ Nominal coverage (and the percentiles used): 90% (2.2%, 97.8%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -7.191 +44.06 +86.04 +250.6
+ +171.5 -7.860 +44.42 +82.39 +251.9
Demonstration 7
@@ -395,11 +395,11 @@
Demonstration 7
Number of resamples (outer): 1999
Number of resamples (inner): 199
Confidence interval (CI) type: Calibrated percentile
- Nominal coverage (and the percentiles used): 90% (12.0%, 99.5%)
+ Nominal coverage (and the percentiles used): 90% (11.1%, 99.5%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +171.5 -7.271 +45.86 +113.8 +282.4
+ +171.5 -6.858 +44.63 +111.1 +277.5
Demonstration 8
@@ -425,8 +425,8 @@
Demonstration 8
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +0.2278 +0.05796 +0.3038 -0.2667 +0.7195
- +0.5514 -0.06078 +0.4989 -0.2452 +1.394
+ +0.1422 -0.001048 +0.3051 -0.3470 +0.6634
+ +0.2758 -0.007181 +0.3225 -0.2429 +0.8094
Demonstration 9
@@ -452,15 +452,115 @@
Demonstration 9
Number of resamples (outer): 1999
Number of resamples (inner): 0
Confidence interval (CI) type: Bias-corrected and accelerated (BCa)
- Nominal coverage (and the percentiles used): 95% (0.5%, 93.4%)
+ Nominal coverage (and the percentiles used): 95% (0.5%, 93.3%)
Bootstrap Statistics:
original bias std_error CI_lower CI_upper
- +0.7764 -0.006225 +0.1351 +0.3601 +0.9457
+ +0.7764 -0.006608 +0.1408 +0.3172 +0.9490
Demonstration 10
The following code
+
+
+ ## We can also use bootstrap to calculate confidence intervals in multinomial
+ ## classification problems, which we will illustrate below using multinomial
+ ## regression with an ordinal reponse and a proportional odds model. The
+ ## example is taken from https://uk.mathworks.com/help/stats/mnrfit.html
+
+ ##>>>>>>>>>> This code block must be run first in Octave only >>>>>>>>>>>>
+ try
+ pkg load statistics
+ load carbig
+ ## Octave Statistics package does not currently have the mnrfit function, so
+ ## we will use it's logistic_regression function for fitting ordinal models
+ ## instead.
+ function [B, DEV] = mnrfit (X, Y, varargin)
+ ## Note that the logistic_regression function is only suitable when
+ ## the outcome is ordinal, so we would need to use append 'model',
+ ## 'ordinal' as a name-value pair in MATLAB when executing it's
+ ## mnrfit function (see below)
+ [INTERCEPT, SLOPE, DEV] = logistic_regression (Y - 1, X, false);
+ B = cat (1, INTERCEPT, SLOPE);
+ end
+ stats_pkg = true;
+ catch
+ stats_pkg = false;
+ fprintf ('\nSkipping this demo...')
+ fprintf ('\nRequired feaures of the statistics package not found.\n\n');
+ end
+ ##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ if (stats_pkg)
+
+ ##>>>>>>>>>>>>>>>>>>> This code block is the demo >>>>>>>>>>>>>>>>>>>>>>
+
+ ## Create the dataset
+ load carbig
+ X = [Acceleration Displacement Horsepower Weight];
+
+ ## The responses 1 - 4 correspond to the following classification:
+ ## 1: < 19 miles per gallon
+ ## 2: 19 - 29 miles per gallon
+ ## 3: 29 - 39 miles per gallon
+ ## 4: >= 39 miles per gallon
+ miles = [1,1,1,1,1,1,1,1,1,1,NaN,NaN,NaN,NaN,NaN,1,1,NaN,1,1,2,2,1,2, ...
+ 2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,NaN,2,1,1,2,1,1,1,1,1,1,1,1,1, ...
+ 2,2,1,2,2,3,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1, ...
+ 1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1, ...
+ 1,1,2,2,2,1,2,2,2,1,1,3,2,2,2,1,2,2,1,2,2,2,1,3,2,3,2,1,1,1, ...
+ 1,1,1,1,1,3,2,2,3,3,2,2,2,2,2,3,2,1,1,1,1,1,1,1,1,1,1,1,2,2, ...
+ 1,3,2,2,2,2,2,2,1,3,2,2,2,2,2,3,2,2,2,2,2,1,1,1,1,2,2,2,2,3, ...
+ 2,3,3,2,1,1,1,3,3,2,2,2,1,2,2,1,1,1,1,1,3,3,3,2,3,1,1,1,1,1, ...
+ 2,2,1,1,1,1,1,3,2,2,2,3,3,3,3,2,2,2,4,3,3,4,3,2,2,2,2,2,2,2, ...
+ 2,2,2,2,1,1,2,1,1,1,3,2,2,3,2,2,2,2,2,1,2,1,3,3,2,2,2,2,2,1, ...
+ 1,1,1,1,1,2,1,3,3,3,2,2,2,2,2,3,3,3,3,2,2,2,3,4,3,3,3,2,2,2, ...
+ 2,3,3,3,3,3,4,2,4,4,4,3,3,4,4,3,3,3,2,3,2,3,2,2,2,2,3,4,4,3, ...
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,2,NaN,3,2,2,2,2,2,1,2,2,3,3,3,2,2, ...
+ 2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,3,2,2,4,3,2,3]';
+
+ ## Bootsrap confidence intervals for each logistic regression coefficient
+ bootknife ({X, miles}, 1999, ...
+ @(X, miles) mnrfit (X, miles, 'model', 'ordinal'));
+
+ ## Where the first three rows are the intercept terms, and the last 4 rows
+ ## are the slope coefficients. For each predictor, the slope coefficient
+ ## corresponds to how a unit change in the predictor impacts on the odds
+ ## across the (ordered) catagories, where each log-odds is:
+ ##
+ ## ln ((P below) / (P above))
+ ##
+ ## Therefore, a positive slope value indicates that a unit increase in the
+ ## predictor increases the odds of running at fewer miles per gallon.
+
+ ##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ end
+
Produces the following output
+
Summary of nonparametric bootstrap estimates of bias and precision
+******************************************************************************
+
+Bootstrap settings:
+ Function: @(X, miles) mnrfit (X, miles, 'model', 'ordinal')
+ Resampling method: Balanced, bootknife resampling
+ Number of resamples (outer): 1999
+ Number of resamples (inner): 0
+ Confidence interval (CI) type: Bias-corrected and accelerated (BCa)
+ Nominal coverage: 95%
+
+Bootstrap Statistics:
+ original bias std_error CI_lower CI_upper
+ -16.69 -0.5285 +2.069 -20.35 -12.67
+ -11.72 -0.3726 +1.830 -15.03 -8.126
+ -8.061 -0.2703 +1.730 -11.35 -4.674
+ +0.1048 +0.005832 +0.09156 -0.08012 +0.2790
+ +0.01034 +0.0006579 +0.006671 -0.002498 +0.02337
+ +0.06452 +0.002303 +0.01631 +0.03293 +0.09395
+ +0.001664 +1.103e-05 +0.0007399 +0.0002213 +0.003098
+
+Demonstration 11
+
+
The following code
## Air conditioning failure times (x) in Table 1.2 of Davison A.C. and
@@ -567,7 +667,7 @@ Demonstration 10
## ---------------------------|----------|--------|--------|--------|-------|
gives an example of how 'bootknife' is used.
-Demonstration 11
+Demonstration 12
The following code
diff --git a/docs/function/bootlm.html b/docs/function/bootlm.html
index 91e9ceba..a748f0bc 100644
--- a/docs/function/bootlm.html
+++ b/docs/function/bootlm.html
@@ -3,7 +3,7 @@
-
+
@@ -480,7 +480,7 @@ Demonstration 1
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-female - male +10.80 -8.686 +30.29 .248
+female - male +10.80 -8.650 +30.25 .243
MODEL FORMULA (based on Wilkinson's notation):
@@ -491,8 +491,8 @@ Demonstration 1
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-male +44.20 +32.47 +53.35 5
-female +55.00 +42.56 +67.59 6
+male +44.20 +32.51 +53.02 5
+female +55.00 +42.56 +67.82 6
and the following figure
@@ -537,7 +537,7 @@ Demonstration 2
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-after - before +1.460 +0.6532 +2.267 .003
+after - before +1.460 +0.6513 +2.269 .002
MODEL FORMULA (based on Wilkinson's notation):
@@ -548,8 +548,8 @@ Demonstration 2
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-before +4.560 +4.124 +5.005 5
-after +6.020 +5.565 +6.474 5
+before +4.560 +4.108 +5.000 5
+after +6.020 +5.577 +6.478 5
and the following figure
@@ -591,9 +591,9 @@ Demonstration 3
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-st - al1 +7.000 +3.880 +10.12 <.001
-st - al2 +5.000 +2.530 +7.470 .001
-al1 - al2 -2.000 -4.907 +0.9069 .168
+st - al1 +7.000 +3.868 +10.13 <.001
+st - al2 +5.000 +2.542 +7.458 <.001
+al1 - al2 -2.000 -4.870 +0.8703 .170
MODEL FORMULA (based on Wilkinson's notation):
@@ -604,9 +604,9 @@ Demonstration 3
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-st +84.00 +82.14 +85.69 8
-al1 +77.00 +75.01 +79.40 6
-al2 +79.00 +77.72 +80.48 6
+st +84.00 +82.09 +85.68 8
+al1 +77.00 +74.93 +79.40 6
+al2 +79.00 +77.72 +80.44 6
and the following figure
@@ -654,9 +654,9 @@ Demonstration 4
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-1 - 2 -2.000 -2.722 -1.278 <.001
-1 - 5 -3.200 -3.859 -2.541 <.001
-2 - 5 -1.200 -2.091 -0.3086 .013
+1 - 2 -2.000 -2.738 -1.262 <.001
+1 - 5 -3.200 -3.848 -2.552 <.001
+2 - 5 -1.200 -2.087 -0.3132 .012
MODEL FORMULA (based on Wilkinson's notation):
@@ -667,9 +667,9 @@ Demonstration 4
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-1 +11.00 +10.67 +11.38 10
-2 +13.00 +12.55 +13.49 10
-5 +14.20 +13.75 +14.64 10
+1 +11.00 +10.63 +11.34 10
+2 +13.00 +12.51 +13.47 10
+5 +14.20 +13.77 +14.65 10
and the following figure
@@ -740,12 +740,12 @@ Demonstration 5
name coeff CI_lower CI_upper p-val
--------------------------------------------------------------------------------
-(Intercept) +5.667 +4.791 +6.543 <.001
-brands_1 -1.333 -1.892 -0.7744 .009
-brands_2 -2.167 -3.122 -1.212 <.001
-popper_1 +1.167 +0.6018 +1.731 .018
-brands:popper_1 -0.3333 -1.082 +0.4150 .339
-brands:popper_2 -0.1667 -1.242 +0.9086 .730
+(Intercept) +5.667 +4.794 +6.539 <.001
+brands_1 -1.333 -1.898 -0.7691 .011
+brands_2 -2.167 -3.123 -1.210 <.001
+popper_1 +1.167 +0.5958 +1.738 .016
+brands:popper_1 -0.3333 -1.074 +0.4077 .338
+brands:popper_2 -0.1667 -1.260 +0.9266 .726
MODEL FORMULA (based on Wilkinson's notation):
@@ -756,9 +756,9 @@ Demonstration 5
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-Gourmet - National +1.500 +1.130 +1.870 <.001
-Gourmet - Generic +2.250 +1.698 +2.802 <.001
-National - Generic +0.7500 +0.2120 +1.288 .009
+Gourmet - National +1.500 +1.131 +1.869 <.001
+Gourmet - Generic +2.250 +1.710 +2.790 <.001
+National - Generic +0.7500 +0.1981 +1.302 .011
MODEL FORMULA (based on Wilkinson's notation):
@@ -769,9 +769,9 @@ Demonstration 5
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-Gourmet +6.250 +6.057 +6.435 6
-National +4.750 +4.561 +4.937 6
-Generic +4.000 +3.664 +4.314 6
+Gourmet +6.250 +6.066 +6.444 6
+National +4.750 +4.563 +4.937 6
+Generic +4.000 +3.681 +4.316 6
MODEL FORMULA (based on Wilkinson's notation):
@@ -782,7 +782,7 @@ Demonstration 5
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-oil - air -1.000 -1.384 -0.6162 <.001
+oil - air -1.000 -1.384 -0.6160 <.001
MODEL FORMULA (based on Wilkinson's notation):
@@ -793,8 +793,8 @@ Demonstration 5
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-oil +4.500 +4.318 +4.687 9
-air +5.500 +5.313 +5.682 9
+oil +4.500 +4.316 +4.691 9
+air +5.500 +5.309 +5.679 9
and the following figure
@@ -810,9 +810,9 @@ Demonstration 6
## Unbalanced two-way design (2x2). The data is from a study on the effects
- ## of gender and a college degree on starting salaries of company employees,
- ## in Maxwell, Delaney and Kelly (2018): Chapter 7, Table 15. The starting
- ## salaries are in units of 1000 dollars per annum.
+ ## of gender and a college degree on starting salaries of a sample of company
+ ## employees, in Maxwell, Delaney and Kelly (2018): Chapter 7, Table 15. The
+ ## starting salaries are in units of 1000 dollars per annum.
salary = [24 26 25 24 27 24 27 23 15 17 20 16, ...
25 29 27 19 18 21 20 21 22 19]';
@@ -890,13 +890,15 @@ Demonstration 6
{'gender', 'degree'}, 'dim', [1, 2], ...
'method', 'bayesian','prior', 'auto');
- ## Ah ha! So it seems that sample sizes are quite unbalanced here, with most
- ## of the women in this company having a degree, while most of the men not.
+ ## Ah ha! So it seems that sample sizes are very unbalanced here, with most
+ ## of the women in this sample having a degree, while most of the men not.
## Since the regression coefficient indicated that a high starting salary is
## an outcome of having a degree, this observation likely explains why
## salaries where not significantly different between men and women when we
## ran the ANOVA with gender listed first in the model (i.e. not accounting
- ## for whether employees had a college degree).
+ ## for whether employees had a college degree). Note that our inferences here
+ ## assume that the unbalanced samples sizes are representative of similar
+ ## imbalance in the company as a whole (i.e. the population).
## Since the interaction term (F(1,18) = 0.42) was not significant (p > 0.1),
## we might rather consider the hypotheses tested using type II sums-of-
@@ -913,7 +915,7 @@ Demonstration 6
{'degree', 'gender'}, 'seed', 1);
fprintf ('\nANOVA SUMMARY (with type II sums-of-squares for main effects)\n')
- fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (Gender)\n', ...
+ fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (gender)\n', ...
AOVSTAT1.DF(2), AOVSTAT1.DFE, AOVSTAT1.F(2), ...
AOVSTAT1.PVAL(2), AOVSTAT1.MODEL{2});
@@ -921,7 +923,7 @@ Demonstration 6
'linear', 'display', 'off', 'varnames', ...
{'gender', 'degree'}, 'seed', 1);
- fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (Degree)\n', ...
+ fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (degree)\n', ...
AOVSTAT2.DF(2), AOVSTAT2.DFE, AOVSTAT2.F(2), ...
AOVSTAT2.PVAL(2), AOVSTAT2.MODEL{2});
@@ -990,8 +992,8 @@ Demonstration 6
ANOVA SUMMARY (with type II sums-of-squares for main effects)
-F(1,19) = 11.31, p = 0.00481 for the model: salary ~ 1 + degree + gender (Gender)
-F(1,19) = 101.13, p = 0.0001 for the model: salary ~ 1 + gender + degree (Degree)
+F(1,19) = 11.31, p = 0.00481 for the model: salary ~ 1 + degree + gender (gender)
+F(1,19) = 101.13, p = 0.0001 for the model: salary ~ 1 + gender + degree (degree)
and the following figure
@@ -1004,6 +1006,132 @@ Demonstration 6
Demonstration 7
The following code
+
+
+ ## One-way design with continuous covariate. The data is from a study of the
+ ## additive effects of species and temperature on chirpy pulses of crickets,
+ ## from Stitch, The Worst Stats Text eveR
+
+ pulse = [67.9 65.1 77.3 78.7 79.4 80.4 85.8 86.6 87.5 89.1 ...
+ 98.6 100.8 99.3 101.7 44.3 47.2 47.6 49.6 50.3 51.8 ...
+ 60 58.5 58.9 60.7 69.8 70.9 76.2 76.1 77 77.7 84.7]';
+ temp = [20.8 20.8 24 24 24 24 26.2 26.2 26.2 26.2 28.4 ...
+ 29 30.4 30.4 17.2 18.3 18.3 18.3 18.9 18.9 20.4 ...
+ 21 21 22.1 23.5 24.2 25.9 26.5 26.5 26.5 28.6]';
+ species = {'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' ...
+ 'ex' 'ex' 'ex' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' ...
+ 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv'};
+
+ ## Perform ANCOVA (type I sums-of-squares)
+ ## Use 'anova' contrasts so that the continuous covariate is centered
+ [STATS, BOOTSTAT, AOVSTAT] = bootlm (pulse, {temp, species}, 'model', ...
+ 'linear', 'continuous', 1, 'display', 'off', ...
+ 'varnames', {'temp', 'species'}, ...
+ 'contrasts', 'anova', 'seed', 1);
+
+ fprintf ('\nANCOVA SUMMARY (with type I sums-of-squares)\n')
+ for i = 1:numel(AOVSTAT.F)
+ fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s\n', ...
+ AOVSTAT.DF(i), AOVSTAT.DFE, AOVSTAT.F(i), ...
+ AOVSTAT.PVAL(i), AOVSTAT.MODEL{i});
+ end
+
+ ## Perform ANCOVA (type II sums-of-squares)
+ ## Use 'anova' contrasts so that the continuous covariate is centered
+ [~, ~, AOVSTAT1] = bootlm (pulse, {temp, species}, 'model', ...
+ 'linear', 'continuous', 1, 'display', 'off', ...
+ 'varnames', {'temp', 'species'}, ...
+ 'contrasts', 'anova', 'seed', 1);
+
+ fprintf ('\nANOVA SUMMARY (with type II sums-of-squares)\n')
+ fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (species)\n', ...
+ AOVSTAT1.DF(2), AOVSTAT1.DFE, AOVSTAT1.F(2), ...
+ AOVSTAT1.PVAL(2), AOVSTAT1.MODEL{2});
+
+ [~, ~, AOVSTAT2] = bootlm (pulse, {species, temp}, 'model', ...
+ 'linear', 'continuous', 2, 'display', 'off', ...
+ 'varnames', {'species', 'temp'}, ...
+ 'contrasts', 'anova', 'seed', 1);
+
+ fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s (temp)\n', ...
+ AOVSTAT2.DF(2), AOVSTAT2.DFE, AOVSTAT2.F(2), ...
+ AOVSTAT2.PVAL(2), AOVSTAT2.MODEL{2});
+
+ ## Estimate regression coefficients using 'anova' contrast coding
+ STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
+ 'continuous', 1, 'display', 'on', ...
+ 'varnames', {'temp', 'species'}, ...
+ 'contrasts', 'anova');
+
+ ## 95% confidence intervals and p-values for the differences in the mean of
+ ## chirpy pulses of ex ad niv species (computed by wild bootstrap).
+ STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
+ 'continuous', 1, 'display', 'on', ...
+ 'varnames', {'temp', 'species'}, 'dim', 2, ...
+ 'posthoc', 'trt_vs_ctrl', 'contrasts', 'anova');
+
+ ## 95% credible intervals for the estimated marginal means of chirpy pulses
+ ## of ex and niv species (computed by Bayesian bootstrap).
+ STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
+ 'continuous', 1, 'display', 'on', ...
+ 'varnames', {'temp', 'species'}, 'dim', 2, ...
+ 'method', 'bayesian', 'prior', 'auto', ...
+ 'contrasts', 'anova');
+
Produces the following output
+
ANCOVA SUMMARY (with type I sums-of-squares)
+F(1,28) = 2474.04, p = 0.0001 for the model: pulse ~ 1 + temp
+F(1,28) = 187.40, p = 0.0001 for the model: pulse ~ 1 + temp + species
+
+ANOVA SUMMARY (with type II sums-of-squares)
+F(1,28) = 187.40, p = 0.0001 for the model: pulse ~ 1 + temp + species (species)
+F(1,28) = 1371.35, p = 0.0001 for the model: pulse ~ 1 + species + temp (temp)
+
+MODEL FORMULA (based on Wilkinson's notation):
+
+pulse ~ 1 + temp + species
+
+MODEL COEFFICIENTS
+
+name coeff CI_lower CI_upper p-val
+--------------------------------------------------------------------------------
+(Intercept) +73.37 +72.70 +74.05 <.001
+temp +3.603 +3.407 +3.799 <.001
+species_1 -10.07 -11.41 -8.725 <.001
+
+
+MODEL FORMULA (based on Wilkinson's notation):
+
+pulse ~ 1 + temp + species
+
+MODEL POSTHOC COMPARISONS
+
+name mean CI_lower CI_upper p-adj
+--------------------------------------------------------------------------------
+niv - ex -10.07 -11.41 -8.716 <.001
+
+
+MODEL FORMULA (based on Wilkinson's notation):
+
+pulse ~ 1 + temp + species
+
+MODEL ESTIMATED MARGINAL MEANS
+
+name mean CI_lower CI_upper N
+--------------------------------------------------------------------------------
+ex +78.41 +77.43 +79.39 14
+niv +68.34 +67.61 +69.17 17
+
and the following figure
+
+
+Figure 1 |
+
+ |
+
+
+
+Demonstration 8
+
+
The following code
## Unbalanced three-way design (3x2x2). The data is from a study of the
@@ -1140,107 +1268,6 @@ Demonstration 7
Figure 1 |
- |
-
-
-
-Demonstration 8
-
-
The following code
-
-
- ## One-way design with continuous covariate. The data is from a study of the
- ## additive effects of species and temperature on chirpy pulses of crickets,
- ## from Stitch, The Worst Stats Text eveR
-
- pulse = [67.9 65.1 77.3 78.7 79.4 80.4 85.8 86.6 87.5 89.1 ...
- 98.6 100.8 99.3 101.7 44.3 47.2 47.6 49.6 50.3 51.8 ...
- 60 58.5 58.9 60.7 69.8 70.9 76.2 76.1 77 77.7 84.7]';
- temp = [20.8 20.8 24 24 24 24 26.2 26.2 26.2 26.2 28.4 ...
- 29 30.4 30.4 17.2 18.3 18.3 18.3 18.9 18.9 20.4 ...
- 21 21 22.1 23.5 24.2 25.9 26.5 26.5 26.5 28.6]';
- species = {'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' 'ex' ...
- 'ex' 'ex' 'ex' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' ...
- 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv' 'niv'};
-
- ## Perform ANCOVA
- ## Use 'anova' contrasts so that the continuous covariate is centered
- [STATS, BOOTSTAT, AOVSTAT] = bootlm (pulse, {temp, species}, 'model', ...
- 'linear', 'continuous', 1, 'display', 'off', ...
- 'varnames', {'temp', 'species'}, ...
- 'contrasts', 'anova');
-
- fprintf ('ANCOVA SUMMARY\n')
- for i = 1:numel(AOVSTAT.F)
- fprintf ('F(%u,%u) = %.2f, p = %.3g for the model: %s\n', ...
- AOVSTAT.DF(i), AOVSTAT.DFE, AOVSTAT.F(i), ...
- AOVSTAT.PVAL(i), AOVSTAT.MODEL{i});
- end
-
- ## Estimate regression coefficients using 'anova' contrast coding
- STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
- 'continuous', 1, 'display', 'on', ...
- 'varnames', {'temp', 'species'}, ...
- 'contrasts', 'anova');
-
- ## 95% confidence intervals and p-values for the differences in the mean of
- ## chirpy pulses of ex ad niv species (computed by wild bootstrap).
- STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
- 'continuous', 1, 'display', 'on', ...
- 'varnames', {'temp', 'species'}, 'dim', 2, ...
- 'posthoc', 'trt_vs_ctrl', 'contrasts', 'anova');
-
- ## 95% credible intervals for the estimated marginal means of chirpy pulses
- ## of ex and niv species (computed by Bayesian bootstrap).
- STATS = bootlm (pulse, {temp, species}, 'model', 'linear', ...
- 'continuous', 1, 'display', 'on', ...
- 'varnames', {'temp', 'species'}, 'dim', 2, ...
- 'method', 'bayesian', 'prior', 'auto', ...
- 'contrasts', 'anova');
-
Produces the following output
-
ANCOVA SUMMARY
-F(1,28) = 2474.04, p = 0.0001 for the model: pulse ~ 1 + temp
-F(1,28) = 187.40, p = 0.0001 for the model: pulse ~ 1 + temp + species
-
-MODEL FORMULA (based on Wilkinson's notation):
-
-pulse ~ 1 + temp + species
-
-MODEL COEFFICIENTS
-
-name coeff CI_lower CI_upper p-val
---------------------------------------------------------------------------------
-(Intercept) +73.37 +72.70 +74.05 <.001
-temp +3.603 +3.408 +3.797 <.001
-species_1 -10.07 -11.41 -8.720 <.001
-
-
-MODEL FORMULA (based on Wilkinson's notation):
-
-pulse ~ 1 + temp + species
-
-MODEL POSTHOC COMPARISONS
-
-name mean CI_lower CI_upper p-adj
---------------------------------------------------------------------------------
-niv - ex -10.07 -11.43 -8.700 <.001
-
-
-MODEL FORMULA (based on Wilkinson's notation):
-
-pulse ~ 1 + temp + species
-
-MODEL ESTIMATED MARGINAL MEANS
-
-name mean CI_lower CI_upper N
---------------------------------------------------------------------------------
-ex +78.41 +77.44 +79.41 14
-niv +68.34 +67.58 +69.18 17
-
and the following figure
-
-
-Figure 1 |
-
|
@@ -1320,8 +1347,8 @@
Demonstration 9
ANOVA / ANCOVA SUMMARY
F(1,53) = 44.02, p = 0.0001 for the model: score ~ 1 + age
F(2,53) = 19.74, p = 0.0001 for the model: score ~ 1 + age + exercise
-F(1,53) = 11.10, p = 0.00196 for the model: score ~ 1 + age + exercise + treatment
-F(2,53) = 4.45, p = 0.0159 for the model: score ~ 1 + age + exercise + treatment + exercise:treatment
+F(1,53) = 11.10, p = 0.00222 for the model: score ~ 1 + age + exercise + treatment
+F(2,53) = 4.45, p = 0.0147 for the model: score ~ 1 + age + exercise + treatment + exercise:treatment
MODEL FORMULA (based on Wilkinson's notation):
@@ -1331,13 +1358,13 @@ Demonstration 9
name coeff CI_lower CI_upper p-val
--------------------------------------------------------------------------------
-(Intercept) +84.58 +83.32 +85.84 <.001
-age +0.5036 +0.1828 +0.8243 .003
-exercise_1 +0.09497 -3.106 +3.296 .950
-exercise_2 -9.594 -12.82 -6.373 <.001
-treatment_1 +4.320 +1.611 +7.028 .002
-exercise:treatment_1 +0.1550 -6.443 +6.753 .961
-exercise:treatment_2 +8.218 +1.763 +14.67 .015
+(Intercept) +84.58 +83.29 +85.86 <.001
+age +0.5036 +0.1874 +0.8197 .003
+exercise_1 +0.09497 -3.118 +3.308 .955
+exercise_2 -9.594 -12.82 -6.364 <.001
+treatment_1 +4.320 +1.715 +6.924 .002
+exercise:treatment_1 +0.1550 -6.387 +6.697 .961
+exercise:treatment_2 +8.218 +1.728 +14.71 .014
MODEL FORMULA (based on Wilkinson's notation):
@@ -1348,11 +1375,11 @@ Demonstration 9
name mean CI_lower CI_upper p-adj
--------------------------------------------------------------------------------
-mid, yes - lo, yes +0.01746 -5.361 +5.396 1.000
-hi, yes - lo, yes -13.70 -18.49 -8.915 <.001
-lo, no - lo, yes +1.529 -3.283 +6.341 1.000
-mid, no - lo, yes +1.701 -3.118 +6.520 1.000
-hi, no - lo, yes -3.957 -9.147 +1.234 .514
+mid, yes - lo, yes +0.01746 -5.617 +5.652 1.000
+hi, yes - lo, yes -13.70 -18.46 -8.949 <.001
+lo, no - lo, yes +1.529 -3.395 +6.452 1.000
+mid, no - lo, yes +1.701 -3.195 +6.597 1.000
+hi, no - lo, yes -3.957 -9.130 +1.217 .502
MODEL FORMULA (based on Wilkinson's notation):
@@ -1363,12 +1390,12 @@ Demonstration 9
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-lo, yes +86.98 +83.34 +90.47 10
-mid, yes +87.00 +83.33 +90.39 10
-hi, yes +73.28 +70.56 +76.23 10
-lo, no +88.51 +86.09 +91.32 10
-mid, no +88.68 +86.31 +91.15 10
-hi, no +83.02 +79.71 +86.50 10
+lo, yes +86.98 +83.41 +90.50 10
+mid, yes +87.00 +83.28 +90.37 10
+hi, yes +73.28 +70.48 +76.11 10
+lo, no +88.51 +86.06 +91.44 10
+mid, no +88.68 +86.27 +91.09 10
+hi, no +83.02 +79.72 +86.48 10
and the following figure
@@ -1416,11 +1443,11 @@ Demonstration 10
name coeff CI_lower CI_upper p-val
--------------------------------------------------------------------------------
-(Intercept) +19.40 +18.43 +20.37 <.001
-score_1 -9.330 -11.32 -7.340 <.001
-score_2 -5.000 -7.791 -2.209 .001
-score_3 -8.000 -11.48 -4.524 <.001
-score_4 -8.000 -11.05 -4.953 <.001
+(Intercept) +19.40 +18.42 +20.38 <.001
+score_1 -9.330 -11.30 -7.359 <.001
+score_2 -5.000 -7.877 -2.123 .002
+score_3 -8.000 -11.50 -4.500 <.001
+score_4 -8.000 -11.04 -4.958 <.001
MODEL FORMULA (based on Wilkinson's notation):
@@ -1431,11 +1458,11 @@ Demonstration 10
name mean CI_lower CI_upper N
--------------------------------------------------------------------------------
-1 +10.00 +8.137 +12.00 8
-2 +18.00 +16.01 +20.68 5
-3 +19.00 +16.99 +21.01 8
-4 +21.00 +19.08 +23.02 7
-5 +29.00 +26.95 +30.94 9
+1 +10.00 +8.169 +11.90 8
+2 +18.00 +16.01 +20.71 5
+3 +19.00 +17.02 +21.06 8
+4 +21.00 +19.01 +22.93 7
+5 +29.00 +26.94 +30.90 9
and the following figure
@@ -1632,27 +1659,27 @@ Demonstration 13
PE =
- 20.477
- 16.800
- 16.340
- 16.220
- 15.191
+ 20.477
+ 16.8
+ 16.34
+ 16.22
+ 15.191
PRESS =
- 1023.83
- 840.00
- 817.01
- 811.02
- 759.53
+ 1023.8
+ 840
+ 817.01
+ 811.02
+ 759.53
RSQ_pred =
- -0.040869
- 0.146016
- 0.169388
- 0.175483
- 0.227832
+ -0.040869
+ 0.14602
+ 0.16939
+ 0.17548
+ 0.22783
Package: statistics-resampling
diff --git a/docs/function/bootmode.html b/docs/function/bootmode.html
index ca733e20..e9d736a9 100644
--- a/docs/function/bootmode.html
+++ b/docs/function/bootmode.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/bootstrp.html b/docs/function/bootstrp.html
index 79754ba3..7885fcb0 100644
--- a/docs/function/bootstrp.html
+++ b/docs/function/bootstrp.html
@@ -3,7 +3,7 @@
-
+
@@ -104,56 +104,56 @@ Demonstration 1
Produces the following output
bootstat =
- 31.077
- 26.615
- 29.731
- 29.231
- 27.885
- 28.962
- 29.231
- 28.654
- 35.615
- 27.654
- 26.462
- 30.885
- 31.731
- 29.615
- 28.308
- 29.538
- 29.923
- 30.115
- 32.538
- 28.962
- 31.385
- 25.231
- 30.154
- 26.115
- 25.231
- 25.962
- 33.654
- 33.269
- 31.154
- 34.385
- 30.962
- 30.808
- 29.192
- 29.038
- 25.769
- 30.192
- 30.231
- 28.192
- 28.808
- 31.269
- 27.692
- 28.231
- 32.346
- 31.385
- 28.500
- 31.038
- 28.192
- 33.308
- 30.231
- 28.038
+ 31.077
+ 26.615
+ 29.731
+ 29.231
+ 27.885
+ 28.962
+ 29.231
+ 28.654
+ 35.615
+ 27.654
+ 26.462
+ 30.885
+ 31.731
+ 29.615
+ 28.308
+ 29.538
+ 29.923
+ 30.115
+ 32.538
+ 28.962
+ 31.385
+ 25.231
+ 30.154
+ 26.115
+ 25.231
+ 25.962
+ 33.654
+ 33.269
+ 31.154
+ 34.385
+ 30.962
+ 30.808
+ 29.192
+ 29.038
+ 25.769
+ 30.192
+ 30.231
+ 28.192
+ 28.808
+ 31.269
+ 27.692
+ 28.231
+ 32.346
+ 31.385
+ 28.5
+ 31.038
+ 28.192
+ 33.308
+ 30.231
+ 28.038
ans = 2.3366
diff --git a/docs/function/bootwild.html b/docs/function/bootwild.html
index eceb4177..eaa2bc05 100644
--- a/docs/function/bootwild.html
+++ b/docs/function/bootwild.html
@@ -3,7 +3,7 @@
-
+
@@ -211,8 +211,8 @@ Demonstration 2
Test Statistics:
original std_err CI_lower CI_upper t-stat p-val FPR
- +175.5 +2.502 +169.7 +181.3 +70.1 <.001 .010
- +0.1904 +0.08261 +0.001630 +0.3792 +2.31 .049 .286
+ +175.5 +2.502 +169.8 +181.2 +70.1 <.001 .010
+ +0.1904 +0.08261 +0.003534 +0.3773 +2.31 .047 .280
Package: statistics-resampling
diff --git a/docs/function/cor.html b/docs/function/cor.html
index f2a1b0d6..c343b4da 100644
--- a/docs/function/cor.html
+++ b/docs/function/cor.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/credint.html b/docs/function/credint.html
index b5f8b66a..4f56a490 100644
--- a/docs/function/credint.html
+++ b/docs/function/credint.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/deffcalc.html b/docs/function/deffcalc.html
index 2b490a8e..4303f4a9 100644
--- a/docs/function/deffcalc.html
+++ b/docs/function/deffcalc.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/images/boot1way_601.png b/docs/function/images/boot1way_601.png
index 3f29d063..b3e04232 100644
Binary files a/docs/function/images/boot1way_601.png and b/docs/function/images/boot1way_601.png differ
diff --git a/docs/function/images/boot1way_701.png b/docs/function/images/boot1way_701.png
index 16c98d85..58875d7c 100644
Binary files a/docs/function/images/boot1way_701.png and b/docs/function/images/boot1way_701.png differ
diff --git a/docs/function/images/bootlm_701.png b/docs/function/images/bootlm_701.png
index a40998d8..c475c394 100644
Binary files a/docs/function/images/bootlm_701.png and b/docs/function/images/bootlm_701.png differ
diff --git a/docs/function/images/bootlm_801.png b/docs/function/images/bootlm_801.png
index c475c394..a40998d8 100644
Binary files a/docs/function/images/bootlm_801.png and b/docs/function/images/bootlm_801.png differ
diff --git a/docs/function/randtest2.html b/docs/function/randtest2.html
index 930aa80a..1e463905 100644
--- a/docs/function/randtest2.html
+++ b/docs/function/randtest2.html
@@ -3,7 +3,7 @@
-
+
@@ -151,9 +151,9 @@ Demonstration 1
@(x, y) log (var (y) ./ var (x)))
Produces the following output
-pval = 0.3600
-pval = 0.2930
-pval = 0.3168
+pval = 0.3562
+pval = 0.277
+pval = 0.30584
Demonstration 2
@@ -181,9 +181,9 @@
Demonstration 2
Produces the following output
-
pval = 0.1289
+pval = 0.12891
pval = 0.037109
-pval = 0.5117
+pval = 0.51172
Demonstration 3
@@ -204,8 +204,8 @@
Demonstration 3
pval = randtest2 ([X GX], [Y GY], false, 5000)
Produces the following output
-
pval = 6.2154e-04
-pval = 0.2000
+
pval = 0.0008
+pval = 0.2
Demonstration 4
@@ -226,8 +226,8 @@
Demonstration 4
pval = randtest2 ([X GX], [Y GY], true, 5000)
Produces the following output
-
pval = 1.6000e-03
-pval = 0.2500
+
pval = 0.0012
+pval = 0.25
Package: statistics-resampling
diff --git a/docs/function/sampszcalc.html b/docs/function/sampszcalc.html
index ffdb55c5..057eb839 100644
--- a/docs/function/sampszcalc.html
+++ b/docs/function/sampszcalc.html
@@ -3,7 +3,7 @@
-
+
@@ -109,7 +109,7 @@ Demonstration 1
n = sampszcalc ('t', 0.8)
Produces the following output
-n = 15
+n = 15
Demonstration 2
@@ -121,7 +121,7 @@
Demonstration 2
n = sampszcalc ('t2', 0.8)
Produces the following output
-
n = 26
+
n = 26
Demonstration 3
@@ -133,7 +133,7 @@
Demonstration 3
n = sampszcalc ('t2', 0.8, [], [], [], 1.5)
Produces the following output
-
n = 39
+
n = 39
Demonstration 4
@@ -145,7 +145,7 @@
Demonstration 4
n = sampszcalc ('z2', 0.8)
Produces the following output
-
n = 25
+
n = 25
Demonstration 5
@@ -157,7 +157,7 @@
Demonstration 5
n = sampszcalc ('r', 0.5)
Produces the following output
-
n = 30
+
n = 30
Package: statistics-resampling
diff --git a/docs/function/smoothmad.html b/docs/function/smoothmad.html
index 5b29df6a..fbe0e3d1 100644
--- a/docs/function/smoothmad.html
+++ b/docs/function/smoothmad.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function/smoothmedian.html b/docs/function/smoothmedian.html
index 5ac85b47..75c785a9 100644
--- a/docs/function/smoothmedian.html
+++ b/docs/function/smoothmedian.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/function_reference.html b/docs/function_reference.html
index 6c484c54..a59152fc 100644
--- a/docs/function_reference.html
+++ b/docs/function_reference.html
@@ -3,7 +3,7 @@
-
+
diff --git a/docs/index.html b/docs/index.html
index 75eb638a..52427deb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -3,7 +3,7 @@
-
+