1 Introduction .
1.1 Overviews of Chaps2–11 .
1.2 Chapter 2 .
1.3 Chapter 3 .
*1.4 Chapter 4 . 1.5 Chapter 5 . 1.6 Chapter 6 . 1.7 Chapter 7 . 1.8 Chapter 8 . 1.9 Chapter 9 . 1.10 Chapter 10 . 1.11 Chapter 11 . 1.12 Summary . 1.13 Preview of Chap2 . References .1
2 The R Programming Language .
2.1 R and RStudio, What are They About? . 2.1.1 What is R? . 2.1.2 Using R: Interactive Versus “Batch” Mode . 2.1.3 Installing R . 2.1.4 RStudio . 2.1.5 R Help . 2.1.6 R Manuals and Books . 2.2 Beginning R and RStudio . 2.2.1 Preliminaries . 2.2.2 R as a Simple Calculator . 2.2.3 Arrow Keys for Using Previous Commands . 2.2.4 Variables . 2.2.5 The Assignment Operator .19 2.2.6 Using Variables in Expressions . 2.2.7 Removing Variables—Using R Functions . 2.2.8 Mathematical Functions . 2.2.9 Nesting of Commands . 2.2.10 Numerical Representations . 2.3 Vectors . 2.3.1 Creating Vector Variables . 2.3.2 Using Subscripts: Vector Indexing . 2.3.3 Adding and Removing Vector Elements . 2.3.4 Doing Mathematics with Vectors . 2.3.5 Missing Values . 2.3.6 Random Numbers . 2.3.7 Basic Statistical Functions . 2.4 Basic R Data Types . 2.4.1 Coercion . 2.4.2 Numeric Data . 2.4.3 Logical Data . 2.4.4 Integer Data . 2.4.5 Character Data . 2.4.6 Learning More About Variables .
2.5 Matrices . 2.5.1 Creating Matrices . 2.5.2 Characteristics of a Matrix . 2.5.3 Applying Functions to Query Matrices . 2.5.4 Manipulating Matrices . 2.5.5 Naming Rows and Columns . 2.5.6 Adding New Rows or Columns to Matrices .
2.6 Arrays: More Than Two Dimensions .
2.7 Factors . 2.7.1 Factor Functions . 2.7.2 Useful Data Manipulations with Factors .
2.8 Lists . 2.8.1 Referencing List Elements . 2.8.2 Manipulating Lists . 2.8.3 Search Path Attachment .
2.9 Data Frames . 2.9.1 Viewing and Selecting Data Frame Elements . 2.9.2 Computing Statistics . 2.9.3 Sorting Data Frames . 2.9.4 R’s Sorting Functions . 2.9.5 Adding Rows or Columns to Data Frames . 2.9.6 Creating a New Data Frame . 2.9.7 Editing Values in a Data Frame .
2.10 Saving Work . 2.10.1 Setting and Getting Folder Pathways . 2.10.2 Session History Files . 2.10.3 R Scripts . 2.10.4 Workspace Files . 2.10.5 Writing External Text Files .
2.11 Reading External Text Files . 2.11.1 Reading Files Holding a Single Variable . 2.11.2 Reading Tables of Data with Many Variables . 2.12 Downloading and Installing Packages . 2.13 Programming Structures in R . 2.13.1 The Comment . 2.13.2 Writing Your Own Functions . 2.13.3 Conditional Statements . 2.13.4 Loops . 2.13.5 Writing Interactive Code . 2.14 Summary . 2.15 Preview of Chap3 . References .78
3 Permutation Statistical Methods .
3.1 Introduction .
3.2 A Brief History of Permutation Methods . 3.2.1 The 1920s . 3.2.2 The 1930s . 3.2.3 The 1940s . 3.2.4 The 1950s . 3.2.5 The 1960s . 3.2.6 The 1970s . 3.2.7 The 1980s . 3.2.8 The 1990s . 3.2.9 The 2000s . 3.2.10 The 2010s .
3.3 The Neyman–Pearson Population Model .
3.4 The Fisher–Pitman Permutation Model . 3.4.1 Exact Permutation Tests . 3.4.2 Monte Carlo Permutation Tests .
3.5 Permutation and Parametric Statistical Tests . 3.5.1 The Assumption of Random Sampling . 3.5.2 The Assumption of Normality .
3.6 Advantages of Permutation Methods .
3.7 Calculation Efficiency . 3.7.1 High-Speed Computing . 3.7.2 Analysis with Combinations .101 3.7.3 Mathematical Recursion . 3.7.4 Variable Components of a Test Statistic . 3.7.5 Holding an Array Constant .
3.8 Summary . 3.9 Preview of Chap4 . References .119
4 Central Tendency and Variability .
4.1 Introduction . 4.2 Data Storage Modes and Structures . 4.3 Statistical Graphics .
4.4 The Sample Mode . 4.4.1 R Script for the Sample Mode .
4.5 The Sample Mean . 4.5.1 R Script for the Sample Mean .
4.6 The Sample Median . 4.6.1 R Script for the Sample Median .
4.7 The Sample Standard Deviation and Variance . 4.7.1 R Script for the Sample Standard Deviation .
4.8 The Mean Absolute Deviation . 4.8.1 R Script for the Mean Absolute Deviation .
4.9 An Alternative Approach to Dispersion Measures . 4.9.1 Pairwise Differences: Standard Deviation . 4.9.2 R Script for the Sample Standard Deviation . 4.10 Summary . 4.11 Preview of Chap5 . Reference .125
5 One-Sample Tests .
5.1 Introduction . 5.2 Student’s One-Sample t Test . 5.3 A Permutation Approach . 5.4 The Relationship Between Test Statistics t and d .
5.5 Test Statistics t and d . 5.5.1 R Script for Student’s t Test . 5.5.2 R Script for Test Statistic d . 5.5.3 R Script for an Exact Student’s t Test . 5.5.4 The Choice Between Test Statistics t and d .
5.6 The Measurement of Effect Size . 5.6.1 R Script for the Expected Value of d .
5.7 Detailed Calculations for Statistics d and ld . 5.7.1 Comparisons of Effect Size Measures . 5.7.2 R Script for the R Measure of Effect Size .155
5.8Measures of Effect Size . 5.8.1 R Script for Measures of Effect Size .
5.9 Analyses with v ¼ 2 and v ¼ 1 . 5.9.1 An Exact Analysis with v ¼ 2 . 5.9.2 R Script for Test Statistic d . 5.9.3 The Assumption of Normality . 5.9.4 An Exact Analysis with v ¼ 1 .
5.10 Exact and Monte Carlo Analyses . 5.10.1 A Monte Carlo Analysis with v ¼ 2 . 5.10.2 R Script for a Monte Carlo Analysis . 5.10.3 An Exact Analysis with v ¼ 2 . 5.10.4 A Monte Carlo Analysis with v ¼ 1 . 5.10.5 An Exact Analysis with v ¼ 1 .
5.11 Rank-Score Permutation Analyses . 5.11.1 The Wilcoxon Signed-Ranks Test . 5.11.2 A Permutation Approach . 5.11.3 An Example Analysis . 5.11.4 R Script for Wilcoxon’s Signed-Ranks Test . 5.11.5 An Exact Analysis with v ¼ 2 . 5.11.6 The Relationship Between Statistics T and d . 5.11.7 R Script for a Monte Carlo Probability Value . 5.11.8 An Exact Analysis with v ¼ 1 . 5.12 Summary . 5.13 Preview of Chap6 . References .181
6 Two-Sample Tests .
6.1 Introduction .
6.2 Two-Sample Tests . 6.2.1 Student’s Two-Sample t Test .
6.3 A Permutation Approach . 6.3.1 The Relationship Between Statistics t and d .
6.4 Test Statistics t and d . 6.4.1 R Script for a Test of Homogeneity . 6.4.2 R Script for Student’s t Test . 6.4.3 A Permutation Approach . 6.4.4 R Script for Test Statistic d .
6.5 Measures of Effect Size . 6.5.1 Comparisons of Effect Size Measures . 6.5.2 R Script for Measures of Effect Size .
6.6 Analyses with v ¼ 2 and v ¼ 1 . 6.6.1 An Exact Analysis with v ¼ 2 . 6.6.2 Measures of Effect Size . 6.6.3 An Exact Analysis with v ¼ 1 .223
6.7 Exact and Monte Carlo Analyses . 6.7.1 A Monte Carlo Analysis with v ¼ 2 . 6.7.2 R Script for a Monte Carlo Analysis . 6.7.3 Measures of Effect Size . 6.7.4 A Monte Carlo Analysis with v ¼ 1 .
6.8 Rank-Score Permutation Analyses . 6.8.1 The Wilcoxon–Mann–Whitney Test . 6.8.2 R Script for the Wilcoxon Rank-Sum Test . 6.8.3 An Exact Analysis with v ¼ 2 . 6.8.4 R Script for an Exact Wilcoxon Test . 6.8.5 An Exact Analysis with v ¼ 1 .
6.9 Summary . 6.10 Preview of Chap7 . References .264
7 Matched-Pairs Tests .
7.1 Introduction .
7.2 Matched-Pairs Tests . 7.2.1 Student’s Matched-Pairs t Test .
7.3 A Permutation Approach . 7.3.1 The Relationship Between Statistics t and d .
7.4 Test Statistics t and d . 7.4.1 R Script for Student’s Matched-Pairs t Test . 7.4.2 An Exact Analysis . 7.4.3 R Script for an Exact Matched-Pairs Test .
7.5 Measures of Effect Size . 7.5.1 Comparisons of Effect Size Measures . 7.5.2 R Script for Measures of Effect Size .
7.6 Analyses with v ¼ 2 and v ¼ 1 . 7.6.1 An Exact Analysis with v ¼ 2 . 7.6.2 R Script for an Exact Student’s t Test . 7.6.3 An Exact Analysis with v ¼ 1 . 7.6.4 A Comparison of v ¼ 2 and v ¼ 1 .
7.7 Exact and Monte Carlo Analyses . 7.7.1 A Monte Carlo Analysis with v ¼ 2 . 7.7.2 R Script for a Monte Carlo Analysis . 7.7.3 An Exact Analysis with v ¼ 2 . 7.7.4 A Monte Carlo Analysis with v ¼ 1 . 7.7.5 An Exact Analysis with v ¼ 1 .
7.8 Rank-Score Permutation Analyses . 7.8.1 The Wilcoxon Signed-Ranks Test . 7.8.2 R Script for Wilcoxon’s Signed-Ranks Test . 7.8.3 An Exact Analysis with v ¼ 2 . 7.8.4 R Script for an Exact Signed-Ranks Test .295 7.8.5 The Relationship Between Statistics T and d . 7.8.6 An Exact Analysis with v ¼ 1 . 7.9 Summary . 7.10 Preview of Chap8 . References .352
8 Completely-Randomized Designs .
8.1 Introduction . 8.2 Fisher’s F-Ratio Test . 8.3 A Permutation Approach . 8.4 The Relationship Between Statistics F and d .
8.5 Test Statistics F and d . 8.5.1 The Bartlett Test for Homogeneity . 8.5.2 R Script for Bartlett’s Test of Homogeneity . 8.5.3 The Analysis of Variance . 8.5.4 R Script for an Analysis of Variance . 8.5.5 An Alternative to R Function aov() . 8.5.6 A Permutation Approach . 8.5.7 R Script for Test Statistic d .
8.6 Measures of Effect Size . 8.6.1 Comparisons of Effect Size Measures . 8.6.2 R Script for Measures of Effect Size .
8.7 Analyses with v ¼ 2 and v ¼ 1 . 8.7.1 The Analysis of Variance . 8.7.2 A Monte Carlo Analysis with v ¼ 2 . 8.7.3 Measures of Effect Size . 8.7.4 A Monte Carlo Analysis with v ¼ 1 .
8.8 Exact and Monte Carlo Analyses . 8.8.1 The Analysis of Variance . 8.8.2 A Monte Carlo Analysis with v ¼ 2 . 8.8.3 Measures of Effect Size . 8.8.4 A Monte Carlo Analysis with v ¼ 1 .
8.9 Rank-score Permutation Analyses . 8.9.1 The Kruskal–Wallis Rank-sum Test . 8.9.2 R Script for the Kruskal–Wallis Rank-sum Test . 8.9.3 A Monte Carlo Analysis with v ¼ 2 . 8.9.4 R Script for a K–W Probability Value . 8.10 Summary . 8.11 Preview of Chap9 . References .357
9 Randomized-Blocks Designs .
9.1 Introduction .
9.2 Randomized-Blocks Analysis of Variance . 9.2.1 Fisher’s F-Ratio Test Statistic . 9.3 A Permutation Approach . 9.4 The Relationship Between Statistics F and d . 9.5 Test Statistics F and d . 9.5.1 R Script for a Randomized-Blocks Analysis . 9.5.2 An Exact Analysis with v ¼ 2 . 9.5.3 R Script for a Permutation Analysis .
9.6 Measures of Effect Size . 9.6.1 An Example Analysis . 9.6.2 R Script for Three Measures of Effect Size .
9.7 Analyses with v ¼ 2 and v ¼ 1 . 9.7.1 A Monte Carlo Analysis with v ¼ 2 . 9.7.2 R Script for a Monte Carlo Analysis . 9.7.3 Measures of Effect Size . 9.7.4 A Monte Carlo Analysis with v ¼ 1 .
9.8 A Larger Monte Carlo Analysis . 9.8.1 A Monte Carlo Analysis with v ¼ 2 . 9.8.2 Measures of Effect Size .
9.9 Rank-Score Permutation Analyses . 9.9.1 Friedman’s Analysis of Variance for Ranks . 9.9.2 R Script for Friedman’s Rank-Sum Test . 9.9.3 A Monte Carlo Analysis with v ¼ 2 . 9.9.4 R Script for Friedman’s Rank-Sum Test . 9.9.5 A Monte Carlo Analysis with v ¼ 1 . 9.10 Summary .
9.11 Preview of Chap10 . References .433
10 Correlation and Association .
10.1 Introduction .
10.2 Linear Correlation . 10.2.1 A Permutation Approach . 10.3 The Relationship Between Statistics rxy and d .
10.4 An Example Analysis . 10.4.1 R Script for Pearson’s Correlation Coefficient . 10.4.2 An Exact Permutation Analysis . 10.4.3 R Script for an Exact Analysis . 10.4.4 R Script for a Monte Carlo Analysis .
10.5 A Measure of Effect Size . 10.5.1 A Monte Carlo Permutation Analysis .499
10.6 Spearman’s Rank-Order Correlation Coefficient . 10.6.1 The Relationship Between Statistics rs and d . 10.6.2 R Script for Spearman’s Rank Correlation . 10.6.3 A Monte Carlo Permutation Analysis . 10.6.4 R Script for a Monte Carlo Analysis . 10.6.5 R Script for an Exact Analysis .
10.7 Kendall’s sa Measure of Association . 10.7.1 An Example . 10.7.2 The Relationship Between Kendall’s S and d . 10.7.3 R Script for Kendall’s sa Coefficient . 10.7.4 A Monte Carlo Permutation Analysis . 10.7.5 R Script for a Monte Carlo Analysis . 10.7.6 An Exact Permutation Analysis . 10.7.7 R Script for an Exact Analysis .
10.8 Kendall’s sb Measure of Association . 10.8.1 Example Analysis . 10.8.2 R Script for Kendall’s sb Coefficient . 10.8.3 R Script for a Monte Carlo Analysis . 10.8.4 An Exact Permutation Analysis . 10.8.5 R Script for an Exact Analysis .
10.9 The Analysis of Contingency Tables . 10.9.1 R Script for Analyzing a Contingency Table .
10.10 Spearman’s Footrule Agreement Measure . 10.10.1 The Relationship Between R and < . 10.10.2 A Monte Carlo Analysis . 10.10.3 R Script for an Exact Analysis . 10.11 The Relationship Between R and S . 10.12 Summary . 10.13 Preview of Chap11 . References .526