SAS Part001
Transcript of SAS Part001
-
7/27/2019 SAS Part001
1/15
Sampling, Regression, Experimental Design and Analysis for
Environmental Scientists, Biologists, and Resource Managers
C. J. Schwarz
Department of Statistics and Actuarial Science, Simon Fraser University
December 21, 2012
-
7/27/2019 SAS Part001
2/15
Contents
1 In the beginning... 15
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2 Effective note taking strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.3 Its all to me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.4 Which computer package? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.5 FAQ - Frequently Asked Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.5.1 Accessing journal articles from home . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.5.2 Downloading from the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.5.3 Printing 2 pages per physical page and on both sides of the paper . . . . . . . . . . . 28
1.5.4 Is there an on-line textbook? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2 Introduction to Statistics 30
2.1 TRRGET - An overview of statistical inference . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2 Parameters, Statistics, Standard Deviations, and Standard Errors . . . . . . . . . . . . . . . 34
2.2.1 A review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.2.2 Theoretical example of a sampling distribution . . . . . . . . . . . . . . . . . . . . 39
2.3 Confidence Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.3.1 A review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.2 Some practical advice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.3.3 Technical details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.4 Hypothesis testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.4.1 A review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.4.2 Comparing the population parameter against a known standard . . . . . . . . . . . . 51
2.4.3 Comparing the population parameter between two groups . . . . . . . . . . . . . . 58
2.4.4 Type I, Type II and Type III errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.4.5 Some practical advice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.4.6 The case against hypothesis testing . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.4.7 Problems with p-values - what does the literature say? . . . . . . . . . . . . . . . . 69
Statistical tests in publications of the Wildlife Society . . . . . . . . . . . . . . . . . 69
The Insignificance of Statistical Significance Testing . . . . . . . . . . . . . . . . . 69
Followups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.5 Meta-data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712.5.1 Scales of measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.5.2 Types of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
1
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
3/15
CONTENTS
2.5.3 Roles of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.6 Bias, Precision, Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.7 Types of missing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.8 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792.8.2 Conditions under which a log-normal distribution appears . . . . . . . . . . . . . . 80
2.8.3 ln() vs. log() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802.8.4 Mean vs. Geometric Mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
2.8.5 Back-transforming estimates, standard errors, and ci . . . . . . . . . . . . . . . . . 82
Mean on log-scale back to MEDIAN on anti-log scale . . . . . . . . . . . . . . . . 82
2.8.6 Back-transforms of differences on the log-scale . . . . . . . . . . . . . . . . . . . . 83
2.8.7 Some additional readings on the log-transform . . . . . . . . . . . . . . . . . . . . 84
2.9 Standard deviations and standard errors revisited . . . . . . . . . . . . . . . . . . . . . . . 95
2.10 Other tidbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.10.1 Interpreting p-values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.10.2 False positives vs. false negatives . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.10.3 Specificity/sensitivity/power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3 Sampling 106
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.1.1 Difference between sampling and experimental design . . . . . . . . . . . . . . . . 108
3.1.2 Why sample rather than census? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.1.3 Principle steps in a survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.1.4 Probability sampling vs. non-probability sampling . . . . . . . . . . . . . . . . . . 110
3.1.5 The importance of randomization in survey design . . . . . . . . . . . . . . . . . . 111
3.1.6 Model vs. Design based sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.1.7 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.2 Overview of Sampling Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.2.1 Simple Random Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.2.2 Systematic Surveys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.2.3 Cluster sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1203.2.4 Multi-stage sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.2.5 Multi-phase designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
3.2.6 Panel design - suitable for long-term monitoring . . . . . . . . . . . . . . . . . . . 128
3.2.7 Sampling non-discrete objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.2.8 Key considerations when designing or analyzing a survey . . . . . . . . . . . . . . 129
3.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
3.4 Simple Random Sampling Without Replacement (SRSWOR) . . . . . . . . . . . . . . . . . 131
3.4.1 Summary of main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
3.4.2 Estimating the Population Mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
3.4.3 Estimating the Population Total . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
3.4.4 Estimating Population Proportions . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.4.5 Example - estimating total catch of fish in a recreational fishery . . . . . . . . . . . 1 3 4
What is the population of interest? . . . . . . . . . . . . . . . . . . . . . . . . . . . 136What is the frame? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
What is the sampling design and sampling unit? . . . . . . . . . . . . . . . . . . . . 137
c2012 Carl James Schwarz 2 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
4/15
CONTENTS
Excel analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
SASanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
3.5 Sample size determination for a simple random sample . . . . . . . . . . . . . . . . . . . . 141
3.5.1 Example - How many angling-parties to survey . . . . . . . . . . . . . . . . . . . . 144
3.6 Systematic sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1473.6.1 Advantages of systematic sampling . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.6.2 Disadvantages of systematic sampling . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.6.3 How to select a systematic sample . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.6.4 Analyzing a systematic sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.6.5 Technical notes - Repeated systematic sampling . . . . . . . . . . . . . . . . . . . . 149
Example of replicated subsampling within a systematic sample . . . . . . . . . . . . 149
3.7 Stratified simple random sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
3.7.1 A visual comparison of a simple random sample vs. a stratified simple random sample154
3.7.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
3.7.3 Summary of main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
3.7.4 Example - sampling organic matter from a lake . . . . . . . . . . . . . . . . . . . . 164
3.7.5 Example - estimating the total catch of salmon . . . . . . . . . . . . . . . . . . . . 168
What is the population of interest? . . . . . . . . . . . . . . . . . . . . . . . . . . . 169What is the sampling frame? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
What is the sampling design? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Excel analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
SASanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
When should the various estimates be used? . . . . . . . . . . . . . . . . . . . . . . 175
3.7.6 Sample Size for Stratified Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
3.7.7 Allocating samples among strata . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
3.7.8 Example: Estimating the number of tundra swans. . . . . . . . . . . . . . . . . . . 183
3.7.9 Post-stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
3.7.10 Allocation and precision - revisited . . . . . . . . . . . . . . . . . . . . . . . . . . 189
3.8 Ratio estimation in SRS - improving precision with auxiliary information . . . . . . . . . . 1 9 0
3.8.1 Summary of Main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
3.8.2 Example - wolf/moose ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192Excel analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
SASAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Post mortem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
3.8.3 Example - Grouse numbers - using a ratio estimator to estimate a population total . . 201
Excel analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
SASanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Post mortem - a question to ponder . . . . . . . . . . . . . . . . . . . . . . . . . . 209
3.9 Additional ways to improve precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
3.9.1 Using both stratification and auxiliary variables . . . . . . . . . . . . . . . . . . . . 210
3.9.2 Regression Estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
3.9.3 Sampling with unequal probability - pps sampling . . . . . . . . . . . . . . . . . . 211
3.10 Cluster sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
3.10.1 Sampling plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
3.10.2 Advantages and disadvantages of cluster sampling compared to SRS . . . . . . . . . 219
3.10.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
c2012 Carl James Schwarz 3 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
5/15
CONTENTS
3.10.4 Summary of main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
3.10.5 Example - estimating the density of urchins . . . . . . . . . . . . . . . . . . . . . . 221
Excel Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
SASAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Planning for future experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273.10.6 Example - estimating the total number of sea cucumbers . . . . . . . . . . . . . . . 227
SASAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
3.11 Multi-stage sampling - a generalization of cluster sampling . . . . . . . . . . . . . . . . . . 235
3.11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
3.11.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
3.11.3 Summary of main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
3.11.4 Example - estimating number of clams . . . . . . . . . . . . . . . . . . . . . . . . 238
Excel Spreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
SASProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
3.11.5 Some closing comments on multi-stage designs . . . . . . . . . . . . . . . . . . . . 242
3.12 Analytical surveys - almost experimental design . . . . . . . . . . . . . . . . . . . . . . . . 242
3.13 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
3.14 Frequently Asked Questions (FAQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2473.14.1 Confusion about the definition of a population . . . . . . . . . . . . . . . . . . . . 247
3.14.2 How is N defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
3.14.3 Multi-stage vs. Multi-phase sampling . . . . . . . . . . . . . . . . . . . . . . . . . 248
3.14.4 What is the difference between a Population and a frame? . . . . . . . . . . . . . . 249
3.14.5 How to account for missing transects. . . . . . . . . . . . . . . . . . . . . . . . . . 249
4 Designed Experiments - Terminology and Introduction 250
4.1 Terminology and Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
4.1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
4.1.2 Treatment, Experimental Unit, and Randomization Structure . . . . . . . . . . . . . 2 5 2
4.1.3 The Three Rs of Experimental Design . . . . . . . . . . . . . . . . . . . . . . . . 255
4.1.4 Placebo Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
4.1.5 Single and bouble blinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2574.1.6 Hawthorne Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
4.2 Applying some General Principles of Experimental Design . . . . . . . . . . . . . . . . . . 258
4.2.1 Experiment 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
4.2.2 Experiment 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
4.2.3 Experiment 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
4.2.4 Experiment 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
4.2.5 Experiment 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
4.3 Some Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
4.3.1 The Salk Vaccine Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
4.3.2 Testing Vitamin C - Mistakes do happen . . . . . . . . . . . . . . . . . . . . . . . . 262
4.4 Key Points in Design of Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
4.4.1 Designing an Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
4.4.2 Analyzing the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2644.4.3 Writing the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
4.5 A Road Map to What is Ahead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
c2012 Carl James Schwarz 4 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
6/15
CONTENTS
4.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
4.5.2 Experimental Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
4.5.3 Some Common Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
5 Single Factor - Completely Randomized Designs (a.k.a. One-way design) 2725.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.2 Randomization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.2.1 Using a random number table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Assigning treatments to experimental units . . . . . . . . . . . . . . . . . . . . . . 275
Selecting from the population . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.2.2 Using a computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Randomly assign treatments to experimental units . . . . . . . . . . . . . . . . . . 277
Randomly selecting from populations . . . . . . . . . . . . . . . . . . . . . . . . . 281
5.3 Assumptions - the overlooked aspect of experimental design . . . . . . . . . . . . . . . . . 285
5.3.1 Does the analysis match the design? . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.3.2 No outliers should be present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.3.3 Equal treatment group population standard deviations? . . . . . . . . . . . . . . . . 287
5.3.4 Are the errors normally distributed? . . . . . . . . . . . . . . . . . . . . . . . . . . 2885.3.5 Are the errors are independent? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.4 Two-sample t-test- Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.5 Example - comparing mean heights of children - two-sample t-test . . . . . . . . . . . . . . 290
5.6 Example - Fat content and mean tumor weights - two-sample t-test . . . . . . . . . . . . . . 297
5.7 Example - Growth hormone and mean final weight of cattle - two-sample t-test . . . . . . . 3 0 3
5.8 Power and sample size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
5.8.1 Basic ideas of power analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
5.8.2 Prospective Sample Size determination . . . . . . . . . . . . . . . . . . . . . . . . 312
5.8.3 Example of power analysis/sample size determination . . . . . . . . . . . . . . . . 313
Using tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Using a package to determine power . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.8.4 Further Readings on Power analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 319
5.8.5 Retrospective Power Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3205.8.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
5.9 ANOVA approach - Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
5.9.1 An intuitive explanation for the ANOVA method . . . . . . . . . . . . . . . . . . . 323
5.9.2 A modeling approach to ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
5.10 Example - Comparing phosphorus content - single-factor CRD ANOVA . . . . . . . . . . . 3 3 1
5.11 Example - Comparing battery lifetimes - single-factor CRD ANOVA . . . . . . . . . . . . . 3 4 3
5.12 Example - Cuckoo eggs - single-factor CRD ANOVA . . . . . . . . . . . . . . . . . . . . . 353
5.13 Multiple comparisons following ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.13.1 Why is there a problem? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.13.2 A simulation with no adjustment for multiple comparisons . . . . . . . . . . . . . . 367
5.13.3 Comparisonwise- and Experimentwise Errors . . . . . . . . . . . . . . . . . . . . . 369
5.13.4 The Tukey-Adjusted t-Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
5.13.5 Recommendations for Multiple Comparisons . . . . . . . . . . . . . . . . . . . . . 3725.13.6 Displaying the results of multiple comparisons . . . . . . . . . . . . . . . . . . . . 373
5.14 Prospective Power and sample sizen - single-factor CRD ANOVA . . . . . . . . . . . . . . 375
c2012 Carl James Schwarz 5 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
7/15
CONTENTS
5.14.1 Using Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
5.14.2 Using SASto determine power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
5.14.3 Retrospective Power Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
5.15 Pseudo-replication and sub-sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
5.16 Frequently Asked Questions (FAQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3815.16.1 What does the F-statistic mean? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
5.16.2 What is a test statistic - how is it used? . . . . . . . . . . . . . . . . . . . . . . . . 381
5.16.3 What is MSE? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
5.16.4 Power - various questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
What is meant by detecting half the difference? . . . . . . . . . . . . . . . . . . . . 382
Do we use the std dev, the std error, or root MSE in the power computations? . . . . 3 8 2
Retrospective power analysis; how is this different from regular (i.e., prospective)
power analysis? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
What does power tell us? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
When to use retrospective and prospective power? . . . . . . . . . . . . . . . . . . 383
When should power be reported . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
What is done with the total sample size reported by JMP? . . . . . . . . . . . . . 3 8 4
5.16.5 How to compare treatments to a single control? . . . . . . . . . . . . . . . . . . . . 3845.16.6 Experimental unit vs. observational unit . . . . . . . . . . . . . . . . . . . . . . . . 384
5.16.7 Effects of analysis not matching design . . . . . . . . . . . . . . . . . . . . . . . . 385
5.17 Table: Sample size determination for a two sample t-test . . . . . . . . . . . . . . . . . . . 388
5.18 Table: Sample size determination for a single factor, fixed effects, CRD . . . . . . . . . . . 3 9 0
5.19 Scientific papers illustrating the methods of this chapter . . . . . . . . . . . . . . . . . . . . 393
5.19.1 Injury scores when trapping coyote with different trap designs . . . . . . . . . . . . 3 9 3
6 Single factor - pairing and blocking 395
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.2 Randomization protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.2.1 Some examples of several types of block designs . . . . . . . . . . . . . . . . . . . 399
Completely randomized design - no blocking . . . . . . . . . . . . . . . . . . . . . 400
Randomized complete block design - RCB design . . . . . . . . . . . . . . . . . . . 400Randomized complete block design - RCB design - missing values . . . . . . . . . . 401
Incomplete block design - not an RCB . . . . . . . . . . . . . . . . . . . . . . . . . 401
Generalized randomized complete block design . . . . . . . . . . . . . . . . . . . . 402
6.3 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
6.3.1 Does the analysis match the design? . . . . . . . . . . . . . . . . . . . . . . . . . . 403
6.3.2 Additivity between blocks and treatments . . . . . . . . . . . . . . . . . . . . . . . 404
6.3.3 No outliers should be present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
6.3.4 Equal treatment group standard deviations? . . . . . . . . . . . . . . . . . . . . . . 406
6.3.5 Are the errors normally distributed? . . . . . . . . . . . . . . . . . . . . . . . . . . 407
6.3.6 Are the errors independent? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
6.4 Comparing two means in a paired design - the Paired t-test . . . . . . . . . . . . . . . . . . 408
6.5 Example - effect of stream slope upon fish abundance . . . . . . . . . . . . . . . . . . . . . 409
6.5.1 Introduction and survey protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4096.5.2 Using a Differences analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
6.5.3 Using a Matched paired analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
c2012 Carl James Schwarz 6 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
8/15
CONTENTS
6.5.4 Using a General Modeling analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.5 Which analysis to choose? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.6 Comments about the original paper . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.6 Example - Quality check on two laboratories . . . . . . . . . . . . . . . . . . . . . . . . . . 421
6.7 Example - Comparing two varieties of barley . . . . . . . . . . . . . . . . . . . . . . . . . 4276.8 Example - Comparing prep of mosaic virus . . . . . . . . . . . . . . . . . . . . . . . . . . 432
6.9 Example - Comparing turbidity at two sites . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.9.1 Introduction and survey protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.9.2 Using a Differences analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.9.3 Using a Matched paired analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
6.9.4 Using a General Modeling analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 443
6.9.5 Which analysis to choose? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
6.10 Power and sample size determination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
6.11 Single Factor - Randomized Complete Block (RCB) Design . . . . . . . . . . . . . . . . . 449
6.11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
6.11.2 The potato-peeling experiment - revisited . . . . . . . . . . . . . . . . . . . . . . . 449
6.11.3 An agricultural example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
6.11.4 Basic idea of the analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4516.12 Example - Comparing effects of salinity in soil . . . . . . . . . . . . . . . . . . . . . . . . 453
6.12.1 Model building - fitting a linear model . . . . . . . . . . . . . . . . . . . . . . . . . 455
6.13 Example - Comparing different herbicides . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
6.14 Example - Comparing turbidity at several sites . . . . . . . . . . . . . . . . . . . . . . . . . 468
6.15 Power and Sample Size in RCBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
6.16 Example - BPK: Blood pressure at presyncope . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.16.1 Experimental protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.16.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
6.16.3 Power and sample size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.17 Final notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
6.18 Frequently Asked Questions (FAQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.18.1 Difference between pairing and confounding . . . . . . . . . . . . . . . . . . . . . 488
6.18.2 What is the difference between a paired design and an RCB design? . . . . . . . . . 4896.18.3 What is the difference between a paired t-test and a two-sample t-test? . . . . . . . 4 8 9
6.18.4 Power in RCB/matched pair design - what is root MSE? . . . . . . . . . . . . . . . 490
6.18.5 Testing for block effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
6.18.6 Presenting results for blocked experiment . . . . . . . . . . . . . . . . . . . . . . . 491
6.18.7 What is a marginal mean? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6.18.8 Multiple experimental units within a block? . . . . . . . . . . . . . . . . . . . . . . 492
6.18.9 How does a block differ from a cluster? . . . . . . . . . . . . . . . . . . . . . . . . 492
7 Incomplete block designs 493
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
7.2 Example: Investigate differences in water quality . . . . . . . . . . . . . . . . . . . . . . . 494
8 Estimating an over all mean with subsampling 5018.1 Average flagellum length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
8.1.1 Average-of-averages approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
c2012 Carl James Schwarz 7 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
9/15
CONTENTS
8.1.2 Using the raw measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
8.1.3 Followup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
9 Single Factor - Sub-sampling and pseudo-replication 513
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5149.2 Example - Fat levels in fish - balanced data in a CRD . . . . . . . . . . . . . . . . . . . . . 514
9.2.1 Analysis based on sample means . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
9.2.2 Analysis using individual values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
9.3 Example - fat levels in fish - unbalanced data in a CRD . . . . . . . . . . . . . . . . . . . . 524
9.4 Example - Effect of UV radiation - balanced data in RCB . . . . . . . . . . . . . . . . . . . 525
9.4.1 Analysis on sample means . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
9.4.2 Analysis using individual values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
9.5 Example - Monitoring Fry Levels - unbalanced data with sampling over time . . . . . . . . 535
9.5.1 Some preliminary plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
9.5.2 Approximate analysis of means . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
9.5.3 Analysis of raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
9.5.4 Planning for future experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
9.6 Example - comparing mean flagella lengths . . . . . . . . . . . . . . . . . . . . . . . . . . 5479.6.1 Average-of-averages approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
9.6.2 Analysis on individual measurements . . . . . . . . . . . . . . . . . . . . . . . . . 562
9.6.3 Followup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
9.7 Final Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
10 Two Factor Designs - Single-sized Experimental units - CR and RCB designs 569
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
10.1.1 Treatment structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Why factorial designs? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
Why not factorial designs? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Displaying and interpreting treatment effects - profile plots . . . . . . . . . . . . . . 573
10.1.2 Experimental unit structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
10.1.3 Randomization structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58110.1.4 Putting the three structures together . . . . . . . . . . . . . . . . . . . . . . . . . . 582
10.1.5 Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
10.1.6 Fixed or random effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
10.1.7 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
10.1.8 General comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
10.2 Example - Effect of photo-period and temperature on gonadosomatic index - CRD . . . . . . 5 8 6
10.2.1 Design issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
10.2.2 Preliminary summary statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
10.2.3 The statistical model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
10.2.4 Fitting the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
10.2.5 Hypothesis testing and estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
10.3 Example - Effect of sex and species upon chemical uptake - CRD . . . . . . . . . . . . . . . 603
10.3.1 Design issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60510.3.2 Preliminary summary statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.3.3 The statistical model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
c2012 Carl James Schwarz 8 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
10/15
CONTENTS
10.3.4 Fitting the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
10.4 Power and sample size for two-factor CRD . . . . . . . . . . . . . . . . . . . . . . . . . . 619
10.5 Unbalanced data - Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
10.6 Example - Stream residence time - Unbalanced data in a CRD . . . . . . . . . . . . . . . . 626
Design issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62710.6.1 Preliminary summary statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
10.6.2 The Statistical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
10.6.3 Hypothesis testing and estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
10.6.4 Power and sample size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
10.7 Example - Energy consumption in pocket mice - Unbalanced data in a CRD . . . . . . . . . 641
10.7.1 Design issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
10.7.2 Preliminary summary statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
10.7.3 The statistical model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
10.7.4 Fitting the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
10.7.5 Hypothesis testing and estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
10.7.6 Adjusting for unequal variances? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
10.8 Example: Use-Dependent Inactivation in Sodium Channel Beta Subunit Mutation - BPK . . 656
10.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65610.8.2 Experimental protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
10.8.3 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
10.9 Blocking in two-factor CRD designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
10.10FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
10.10.1 How to determine sample size in two-factor designs . . . . . . . . . . . . . . . . . 669
10.10.2 What is the difference between a block and a factor? . . . . . . . . . . . . . . . 669
10.10.3 If there is evidence of an interaction, does the analysis stop there? . . . . . . . . . . 6 7 0
10.10.4 When should you use raw means or LSmeans? . . . . . . . . . . . . . . . . . . . . 671
11 SAS CODE NOT DONE 673
12 Two-factor split-plot designs 674
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67412.2 Example - Holding your breath at different water temperatures - BPK . . . . . . . . . . . . 6 7 5
12.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
12.2.2 Standard split-plot analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
12.2.3 Adjusting for body size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
12.2.4 Fitting a regression to temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
12.2.5 Planning for future studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
12.3 Example - Systolic blood pressure before presyncope - BPK . . . . . . . . . . . . . . . . . 698
12.3.1 Experimental protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
12.3.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
12.3.3 Power and sample size determination . . . . . . . . . . . . . . . . . . . . . . . . . 707
13 Analysis of BACI experiments 709
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71013.2 Before-After Experiments - prelude to BACI designs . . . . . . . . . . . . . . . . . . . . . 714
13.2.1 Analysis of stream 1 - yearly averages . . . . . . . . . . . . . . . . . . . . . . . . . 717
13.2.2 Analysis of Stream 1 - individual values . . . . . . . . . . . . . . . . . . . . . . . . 719
c2012 Carl James Schwarz 9 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
11/15
CONTENTS
13.2.3 Analysis of all streams - yearly averages . . . . . . . . . . . . . . . . . . . . . . . . 721
13.2.4 Analysis of all streams - individual values . . . . . . . . . . . . . . . . . . . . . . . 724
13.3 Simple BACI - One year before/after; one site impact; one site control . . . . . . . . . . . . 7 2 6
13.4 Example: Change in density in crabs near a power plant - one year before/after; one site
impact; one site control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72713.4.1 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
13.5 Simple BACI design - limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
13.6 BACI with Multiple sites; One year before/after . . . . . . . . . . . . . . . . . . . . . . . . 737
13.7 Example: Density of crabs - BACI with Multiple sites; One year before/after . . . . . . . . . 739
13.7.1 Converting to an analysis of differences . . . . . . . . . . . . . . . . . . . . . . . . 741
13.7.2 Using ANOVA on the averages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
13.7.3 Using ANOVA on the raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
13.7.4 Model assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
13.8 BACI with Multiple sites; Multiple years before/after . . . . . . . . . . . . . . . . . . . . . 752
13.9 Example: Counting fish - Multiple years before/after; One site impact; one site control . . . 7 5 4
13.9.1 Analysis of the differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
13.9.2 ANOVA on the raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
13.9.3 Model assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76313.10Example: Counting chironomids - Paired BACI - Multiple-years B/A; One Site I/C . . . . . 7 6 4
13.10.1 Analysis of the differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
13.10.2 ANOVA on the raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
13.10.3 Model assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
13.11Example: Fry monitoring - BACI with Multiple sites; Multiple years before/after . . . . . . 7 7 1
13.11.1 A brief digression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
13.11.2 Some preliminary plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
13.11.3 Analysis of the averages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
13.11.4 Analysis of the raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
13.11.5 Power analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
13.12Closing remarks about the analysis of BACI designs . . . . . . . . . . . . . . . . . . . . . . 787
13.13BACI designs power analysis and sample size determination . . . . . . . . . . . . . . . . . 788
13.13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78813.13.2 Power: Before-After design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
Single Location studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
Multiple Location studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
13.13.3 Power: Simple BACI design - one site control/impact; one year before/after; inde-
pendent samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
13.13.4 Power: Multiple sites in control/impact; one year before/after; independent samples . 803
13.13.5 Power: One sites in control/impact; multiple years before/after; no subsampling . . . 8 0 8
13.13.6 Power: General BACI: Multiple sites in control/impact; multiple years before/after;
subsampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
14 Comparing proportions - Chi-square (2) tests 814
14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
14.2 Response variables vs. Frequency Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 81614.3 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
14.4 Single sample surveys - comparing to a known standard . . . . . . . . . . . . . . . . . . . . 820
c2012 Carl James Schwarz 10 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
12/15
CONTENTS
14.4.1 Resource selection - comparison to known habitat proportions . . . . . . . . . . . . 8 2 0
14.4.2 Example: Homicide and Seasons . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
14.5 Comparing sets of proportions - single factor CRD designs . . . . . . . . . . . . . . . . . . 830
14.5.1 Example: Elk habitat usage - Random selection of points . . . . . . . . . . . . . . . 830
14.5.2 Example: Ownership and viability . . . . . . . . . . . . . . . . . . . . . . . . . . 83414.5.3 Example: Sex and Automobile Styling . . . . . . . . . . . . . . . . . . . . . . . . . 839
14.5.4 Example: Marijuana use in college . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
14.5.5 Example: Outcome vs. cause of accident . . . . . . . . . . . . . . . . . . . . . . . 847
14.5.6 Example: Activity times of birds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
14.6 Pseudo-replication - Combining tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
14.7 Simpsons Paradox - Combining tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
14.7.1 Example: Sex bias in admissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
14.7.2 Example: - Twenty-year survival and smoking status . . . . . . . . . . . . . . . . . 858
14.8 More complex designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
14.9 Final notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
14.10Appendix - how the test statistic is computed . . . . . . . . . . . . . . . . . . . . . . . . . 860
14.11Fishers Exact Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
14.11.1 Sampling Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86414.11.2 Hypothesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864
14.11.3 Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864
14.11.4 Example: Relationship between Aspirin Use and MI . . . . . . . . . . . . . . . . . 867
Mechanics of the test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
14.11.5 Avoidance of cane toads by Northern Quolls . . . . . . . . . . . . . . . . . . . . . 870
15 Correlation and simple linear regression 878
15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
15.2 Graphical displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
15.2.1 Scatterplots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
15.2.2 Smoothers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
15.3 Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
15.3.1 Scatter-plot matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88715.3.2 Correlation coefficient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
15.3.3 Cautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
15.3.4 Principles of Causation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
15.4 Single-variable regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895
15.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895
15.4.2 Equation for a line - getting notation straight (no pun intended) . . . . . . . . . . . . 8 9 5
15.4.3 Populations and samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
15.4.4 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
Correct scale of predictor and response . . . . . . . . . . . . . . . . . . . . . . . . 897
Correct sampling scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
No outliers or influential points . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
Equal variation along the line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
Normality of errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
c2012 Carl James Schwarz 11 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
13/15
CONTENTS
Xmeasured without error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
15.4.5 Obtaining Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
15.4.6 Obtaining Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
15.4.7 Residual Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
15.4.8 Example - Yield and fertilizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90315.4.9 Example - Mercury pollution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914
15.4.10 Example - The Anscombe Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . 923
15.4.11 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924
15.4.12 Example: Monitoring Dioxins - transformation . . . . . . . . . . . . . . . . . . . . 925
15.4.13 Example: Weight-length relationships - transformation . . . . . . . . . . . . . . . . 937
A non-linear fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
15.4.14 Power/Sample Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
15.4.15 The perils ofR2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
15.5 A no-intercept model: Fultons Condition Factor K . . . . . . . . . . . . . . . . . . . . . . 950
15.6 Frequent Asked Questions - FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957
15.6.1 Do I need a random sample; power analysis . . . . . . . . . . . . . . . . . . . . . . 957
16 SAS CODE NOT DONE 959
17 SAS CODE NOT DONE 960
18 SAS CODE NOT DONE 961
19 Estimating power/sample size using Program Monitor 962
19.1 Mechanics of MONITOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
19.2 How does MONITOR work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972
19.3 Incorporating process and sampling error . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
19.4 Presence/Absence Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
19.5 WARNING about using testing for temporal trends . . . . . . . . . . . . . . . . . . . . . . 989
20 SAS CODE NOT DONE 991
21 SAS CODE NOT DONE 992
22 SAS CODE NOT DONE 993
23 Logistic Regression - Advanced Topics 994
23.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994
23.2 Sacrificial pseudo-replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 995
23.3 Example: Fox-proofing mice colonies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996
23.3.1 Using the simple proportions as data . . . . . . . . . . . . . . . . . . . . . . . . . . 997
23.3.2 Logistic regression using overdispersion . . . . . . . . . . . . . . . . . . . . . . . . 999
23.3.3 GLIMM modeling the random effect of colony . . . . . . . . . . . . . . . . . . . . 1 0 0 0
23.4 Example: Over-dispersed Seeds Germination Data . . . . . . . . . . . . . . . . . . . . . . 1002
24 SAS CODE NOT DONE 1010
c2012 Carl James Schwarz 12 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/ -
7/27/2019 SAS Part001
14/15
CONTENTS
25 A short primer on residual plots 1011
25.1 Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012
25.2 ANOVA residual plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013
25.3 Logistic Regression residual plots - Part I . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015
25.4 Logistic Regression residual plots - Part II . . . . . . . . . . . . . . . . . . . . . . . . . . . 101625.5 Poisson Regression residual plots - Part I . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017
25.6 Poisson Regression residual plots - Part II . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019
26 SAS CODE NOT DONE 1021
27 Tables 1022
27.1 A table of uniform random digits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1022
27.2 Selected Binomial individual probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026
27.3 Selected Poisson individual probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1034
27.4 Cumulative probability for the Standard Normal Distribution . . . . . . . . . . . . . . . . 1037
27.5 Selected percentiles from the t-distribution . . . . . . . . . . . . . . . . . . . . . . . . . . 1039
27.6 Selected percentiles from the chi-squared-distribution . . . . . . . . . . . . . . . . . . . . 1 0 4 0
27.7 Sample size determination for a two sample t-test . . . . . . . . . . . . . . . . . . . . . . . 104127.8 Power determination for a two sample t-test . . . . . . . . . . . . . . . . . . . . . . . . . . 1043
27.9 Sample size determination for a single factor, fixed effects, CRD . . . . . . . . . . . . . . . 1045
27.10Power determination for a single factor, fixed effects, CRD . . . . . . . . . . . . . . . . . . 1 0 4 9
28 THE END! 1053
28.1 Statisfaction - with apologies to Jagger/Richards . . . . . . . . . . . . . . . . . . . . . . . . 1053
28.2 ANOVA Man with apologies to Lennon/McCartney . . . . . . . . . . . . . . . . . . . . . . 1055
29 An overview of enviromental field studies 1057
29.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058
29.1.1 Survey Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065
Simple Random Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065
Systematic Surveys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067
Cluster sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1070
Multi-stage sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074
Multi-phase designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1076
Summary comparison of designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078
29.1.2 Permanent or temporary monitoring stations . . . . . . . . . . . . . . . . . . . . . . 1079
29.1.3 Refinements that affect precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
Auxiliary variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083
Sampling with unequal probability . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083
29.1.4 Sample size determination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
29.2 Analytical surveys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
29.3 Impact Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087
29.3.1 Before/After contrasts at a single site . . . . . . . . . . . . . . . . . . . . . . . . . 108829.3.2 Repeated before/after sampling at a single site. . . . . . . . . . . . . . . . . . . . . 1 0 8 8
29.3.3 BACI: Before/After and Control/Impact Surveys . . . . . . . . . . . . . . . . . . . 1 0 8 9
29.3.4 BACI-P: Before/After and Control/Impact - Paired designs . . . . . . . . . . . . . . 1092
c2012 Carl James Schwarz 13 December 21, 2012
http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/http://0.0.0.0/h