Skip to content

Commit

Permalink
Merge pull request #3 from gnu-octave/master
Browse files Browse the repository at this point in the history
[pull] master from gnu-octave:master
  • Loading branch information
acpennlab authored Jan 9, 2024
2 parents 7c86599 + 9d7e5a3 commit 90a698e
Show file tree
Hide file tree
Showing 25 changed files with 396 additions and 206 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ In Octave only, you can get a basic overview of the package and it's functions b

### Quick start

Below are some links to some demonstrations on how to perform the equivalent of commonly used statistical tests using the bootstrap or randomization functions from this package:
Below are some links to demonstrations of how the bootstrap or randomization functions from this package can be used to perform robust versions of commonly used statistical tests:

* [t-test to compare two independent samples (assuming equal variances)](https://gnu-octave.github.io/statistics-resampling/function/boot1way.html#1)

Expand Down
15 changes: 10 additions & 5 deletions docs/function/boot.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ <h2>boot</h2>
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
</pre>
<h3>Demonstration 1</h3>

<h3><a name="1">Demonstration 1</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand All @@ -127,7 +128,8 @@ <h3>Demonstration 1</h3>
1 2 3 3 2 1 1 2
1 1 2 1 2 1 3 1</pre>
</div>
<h3>Demonstration 2</h3>

<h3><a name="2">Demonstration 2</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand All @@ -149,7 +151,8 @@ <h3>Demonstration 2</h3>
3 1 1 3 1 2 2 2
3 3 1 2 1 2 2 2</pre>
</div>
<h3>Demonstration 3</h3>

<h3><a name="3">Demonstration 3</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -201,7 +204,8 @@ <h3>Demonstration 3</h3>
2 1 3 1 1 3 3 2
2 3 3 1 1 2 2 1</pre>
</div>
<h3>Demonstration 4</h3>

<h3><a name="4">Demonstration 4</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand All @@ -223,7 +227,8 @@ <h3>Demonstration 4</h3>
36 23 36 23 23 36 36 23 23 23
36 36 23 23 23 23 23 36 23 23</pre>
</div>
<h3>Demonstration 5</h3>

<h3><a name="5">Demonstration 5</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down
196 changes: 129 additions & 67 deletions docs/function/boot1way.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,118 @@ <h2>boot1way</h2>
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
</pre>
<h3>Demonstration 1</h3>

<h3><a name="1">Demonstration 1</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">

% COMPARISON OF TWO INDEPENDENT GROUPS WITH UNEQUAL SAMPLE SIZES
% (analagous to Student's t-test)

y = [54 43
23 34
45 65
54 77
45 46
NaN 65];
g = {'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'};

boot1way (y(:), g(:), 'ref', 'male', 'nboot', 4999);

% Please be patient, the calculations will be completed soon...</pre>
<p>Produces the following output</p>
<pre class="example">Summary of bootstrap multiple comparison tests in a one-way layout
*****************************************************************************
Bootstrap settings:
Function: mean
Bootstrap resampling method: Balanced, bootstrap resampling
Number of bootstrap resamples: 4999
Method for estimating standard errors: Calculated without resampling
Multiple comparison method: Single-step maxT procedure based on Dunnett
Reference group used for comparisons: 2 (male)

-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
| 1 | 1 | 2 | +10.80 | +1.20 | .255 |

-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
|------------|---------------------------------------------------|----------|
| 1 | female | 6 |
| 2 | male | 5 |</pre>
<p>and the following figure</p>
<p><table class="images">
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_101.png" class="demo"/></td>
</tr></table>
</p>
</div>

<h3><a name="2">Demonstration 2</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">

% COMPARISON OF TWO INDEPENDENT GROUPS WITH UNEQUAL SAMPLE SIZES
% (a robust version of Student's t-test)

y = [54 43
23 34
45 65
54 77
45 46
NaN 65];
g = {'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'};

boot1way (y(:), g(:), 'ref', 'male', 'nboot', 4999, 'bootfun', 'robust');

% Please be patient, the calculations will be completed soon...</pre>
<p>Produces the following output</p>
<pre class="example">Summary of bootstrap multiple comparison tests in a one-way layout
*****************************************************************************
Bootstrap settings:
Function: robust
Bootstrap resampling method: Balanced, bootstrap resampling
Number of bootstrap resamples: 4999
Method for estimating standard errors: Leave-one-out jackknife
Multiple comparison method: Single-step maxT procedure based on Dunnett
Reference group used for comparisons: 2 (male)

-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
| 1 | 1 | 2 | +8.721 | +0.77 | .438 |

-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
|------------|---------------------------------------------------|----------|
| 1 | female | 6 |
| 2 | male | 5 |</pre>
<p>and the following figure</p>
<p><table class="images">
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_201.png" class="demo"/></td>
</tr></table>
</p>
</div>

<h3><a name="3">Demonstration 3</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -216,11 +327,12 @@ <h3>Demonstration 1</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_101.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_301.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 2</h3>

<h3><a name="4">Demonstration 4</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -275,65 +387,12 @@ <h3>Demonstration 2</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_201.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_401.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 3</h3>
<div class="demo">
<p>The following code</p>
<pre class="example">

% COMPARISON OF TWO INDEPENDENT GROUPS WITH UNEQUAL SAMPLE SIZES
% (analagous to Student's t-test)

y = [54 43
23 34
45 65
54 77
45 46
NaN 65];
g = {'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'
'male' 'female'};

boot1way (y(:), g(:), 'ref', 'male', 'nboot', 4999);

% Please be patient, the calculations will be completed soon...</pre>
<p>Produces the following output</p>
<pre class="example">Summary of bootstrap multiple comparison tests in a one-way layout
*****************************************************************************
Bootstrap settings:
Function: mean
Bootstrap resampling method: Balanced, bootstrap resampling
Number of bootstrap resamples: 4999
Method for estimating standard errors: Calculated without resampling
Multiple comparison method: Single-step maxT procedure based on Dunnett
Reference group used for comparisons: 2 (male)

-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
| 1 | 1 | 2 | +10.80 | +1.20 | .255 |

-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
|------------|---------------------------------------------------|----------|
| 1 | female | 6 |
| 2 | male | 5 |</pre>
<p>and the following figure</p>
<p><table class="images">
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_301.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 4</h3>
<h3><a name="5">Demonstration 5</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -384,11 +443,12 @@ <h3>Demonstration 4</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_401.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_501.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 5</h3>

<h3><a name="6">Demonstration 6</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -437,11 +497,12 @@ <h3>Demonstration 5</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_501.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_601.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 6</h3>

<h3><a name="7">Demonstration 7</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand All @@ -467,7 +528,7 @@ <h3>Demonstration 6</h3>
-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
| 1 | 2 | 1 | +0.8099 | +1.65 | .161 |
| 1 | 2 | 1 | -0.2285 | -0.44 | .637 |

-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
Expand All @@ -479,11 +540,12 @@ <h3>Demonstration 6</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_601.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_701.png" class="demo"/></td>
</tr></table>
</p>
</div>
<h3>Demonstration 7</h3>

<h3><a name="8">Demonstration 8</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -511,7 +573,7 @@ <h3>Demonstration 7</h3>
-----------------------------------------------------------------------------
| Comparison | Test # | Ref # | Difference | t | p |
|------------|------------|------------|------------|------------|----------|
| 1 | 2 | 1 | +0.5970 | +1.41 | .117 |
| 1 | 2 | 1 | -0.8303 | -1.01 | .192 |

-----------------------------------------------------------------------------
| GROUP # | GROUP label | N |
Expand All @@ -523,7 +585,7 @@ <h3>Demonstration 7</h3>
<tr>
<th class="images">Figure 1</th>
</tr><tr>
<td class="images"><img src="images/boot1way_701.png" class="demo"/></td>
<td class="images"><img src="images/boot1way_801.png" class="demo"/></td>
</tr></table>
</p>
</div>
Expand Down
6 changes: 4 additions & 2 deletions docs/function/bootbayes.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ <h2>bootbayes</h2>
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
</pre>
<h3>Demonstration 1</h3>

<h3><a name="1">Demonstration 1</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down Expand Up @@ -188,7 +189,8 @@ <h3>Demonstration 1</h3>
original bias median stdev CI_lower CI_upper
+184.5 +0.01529 +184.5 1.351 +181.7 +187.2</pre>
</div>
<h3>Demonstration 2</h3>

<h3><a name="2">Demonstration 2</a></h3>
<div class="demo">
<p>The following code</p>
<pre class="example">
Expand Down
Loading

0 comments on commit 90a698e

Please sign in to comment.