Академический Документы
Профессиональный Документы
Культура Документы
Data
Analysis
Psychological Bloomington,
Indiana University
AMSTERDAM
BOSTON
LONDON
Nt-VV YORK
OXFORD
PARIS
SAN PIW'.O
SAN l-'RANCISCX)
ELSEVIER
SINGAPORE
an
SYDNEY
TOKYO
Ai .uk'ink: Press is
imprint
of lilscvier
Contents
CHAPTER 1
Organization: Read
Me First!
1
1
Prerequisites
The Organization of This Book 1.3.1 1.3.2 What Are the Essential Chapters? Where's the
2 3
4
Equivalent
of Traditional Test 4
Gimme Feedback
(Be Polite)
6 6
1.5
Acknowledgments
Part 1
The Basics:
CHAPTER 2
9
10 12 12
13 13 13
Three Goals for Inference from Data 2.2.1 2.2.2 2.2.3 Estimation of Parameter Values Prediction of Data Values Model
Comparison
2.3
Programming Language
Getting and Installing R Invoking R and Using the Command Line
A Simple Example of R in Action
14 15 15
16
Getting
Help in R
in R
1? 18 20
Programming
2.4
Exercises
CHAPTER 3
Probability?
23 24
25
The Set of All Possible Events 3.1.1 Coin Flips: Why You Should Care
Outside or Inside the Head
3.2
Probability:
3.2.1
25
Long-Run Relative
25 28
.
Frequency 3.2.2 3.2.3 3.3 Inside the Head: Subjective Belief Probabilities Assign Numbers to Possibilities
29
Probability Distributions
3.3.1 3.3.2 Discrete Distributions:
30 Probability Mass
30
Density 3.3.3
3.3.4 3.3.5
31
a
Distribution
37 39 40 42
43 44 46
Uncertainty in Beliefs
3.4
Two-Way Distributions
3.4.1 3.4.2 3.4.3
Independence
R Code for R Code for
of Attributes
3.5
R Code 3.5.1
47
47 48 49
3.5.2 3.6
Exercises
CHAPTER 4
Bayes'
4.1
Rule
51 52
Bayes'Rule
4.1.1
Probability
4.1.2 4.1.3
Intuited from a
53
Two-Way
as an
Discrete Table
over
54
The Denominator
Integral
56 56 59
Applied
4.2.1
4.2.2 4.3
Example
with Coin
Flipping
60
63
63
Estimation of Parameter Values Prediction of Data Values Model Comparison Why Bayesian Inference Can Be Difficult Bayesian
63
64
67
68
Reasoning in Everyday
Life
4.4
R Code
4.4.1
R Code for
69
Figure
4.1
69
71
4.5
Exercises
Part 2
Inferring
CHAPTER 5
Binomial
Applied to Proportion
77 78
80 81 84 85
Inferring
5.1 5.2
Binomial
Mathematical
The Likelihood Function: Bernoulli Distribution A Description of Beliefs: The Beta Distribution 5.2.1 5.2.2
Specifying
Beta Prior
5.3
Estimating
the Binomial
Proportion
85 87 88
Predicting Data
Model Comparison How to Do
5.4 5.5
Summary:
RCode 5.5.1
Bayesian
Inference
90 91
R Code for
Figure 5.2
91 95
5.6
Exercises
a
CHAPTER 6
Inferring
6.1
Binomial
Approximation Bayes'
6.2.1 6.3 6.4 6.5 6.6 6.7 Rule for Discrete Values of o
a
6.2
Discrettzing
Estimation
Comparison
Summary
RCode
6.7.1 R Code for
109
109
Figure
109 112
6.8
CHAPTER 7
117
Simple Case
of the Metropolis
on
Algorithm Metropolis
119
7.1.1
A Politician Stumbles
the
Algorithm
7.1.2
A
119
120
Random Walk
Random Walk
122 125
126
More
Metropolis Algorithm
Generally
129
131 132
132
134 136 137
7.3.3
7.4
139
140 143 145 145
Comparison
7.5
7.6
146
Metropolis
146
Algorithm
7.7 Exercises
150
CHAPTER 8
via
155
157
Analysis
Approximation
Metropolis Algorithm
Gibbs Sampling
It with BUGS
8.5
Doing
8.5.1
Sampling the
Prior in BUGS
174 Biases?
175
Underlying
Summary
RCode
8.8.1 R Code for Grid and
177 178
R Code for
Plotting
Posterior Histogram
Exercises
188
CHAPTER 9
Bernoulli Likelihood with Hierarchical Prior 9.1 A Single Coin from a Single Mint 9.1.1 9.2 Posterior via Grid Approximation Coins from
a
191
192 196
Multiple
9.2.1
9.2.2
Single Mint
Approximation
200
203 206
Posterior via Monte Carlo Sampling Outliers and Shrinkage of Individual Estimates
9.2.3
212
Case
219
224 227 228 228
Summary
R Code
9.5.1
Experiment
9.5.2 Code for Analysis of Filtration-Condensation Experiment 9.6 Exercises
228
231 235
CHAPTER 10
Modeling
and Model
as
Comparison
Modeling
241
241 244 244 246
Model Comparison
Hierarchical
Example
Example with "Pseudopriors"
A Realistic
Using
253 254
Comparison
10.4.1
Comparing
Comparison 10.4.2
10.5
Exercises
CHAPTER 11
Null Hypothesis
11.1 11.1.1
Significance Testing
265 267
267
NHST for the Bias of a Coin When the Experimenter Intends to Fix N
270 272
274 274 275 275
Searching
Bayesian Analysis
NHST Analysis
Bayesian Analysis
11.3
Highest Density
277
277 280
Bayesian
HDI
11.4
Multiple Comparisons
11.4.1 NHST Correction for Error
281 Experimentwise
282
11.4.2
Just One
Bayesian
How You Look at It 11.4.3 How Bayesian Analysis Mitigates False Alarms 11.5 What
11.5.1 11.5.2
a
285
Sampling
Planning
286
286
an
287 288
11.6 CHAPTER 12
Exercises to
Testing
Point
("Null")
295
296
12.1.2
12.1.3
Region
of Practical
Equivalence (ROPE)
301
12.2
303
303
307 310
Groups Equal?
12.3
Estimation
12.3.1
Model
Comparison?
310 311
12.3.2 12.4
Recommendations
RCode
12.4.1
R Code for
12.5
Exercises
CHAPTER 13
319
320
320
321
323 325
13.2
Sample
13.2.1
Single Coin
to
326
a
Exclude
Null Value
13.2.2 13.3
13.4
Sample
Power:
Prospective, Retrospective,
Power
and 331
Replication
13.4.1
Analysis Requires
of
Verisimilitude 333
of Simulated Data
13.5 13.6
The
Importance
Sample
Planning
a
334 335
RCode
13.6.1 13.6.2 Size for
Single
Coin
Power and
Sample
Size for
Multiple
13.7
Exercises
Part 3
CHAPTER 14
Applied
14.1
(GLM)
Predictor and Predicted Variables Scale Types: Metric, Ordinal, Nominal Linear Function of Predictor
a
14.1.2 14.1.3
359
Single
14.1.4
14.1.5
366 368
to the
14.1.6 14.1.7
Nominal Predictors
14.1.8 14.1.9
14.1.10 Two
Frequency
14.2 14.3 Cases of the GLM Exercises
CHAPTER 15
on a
Single Group
389
390 392 395
Estimating
Likelihood
15.1.1
15.1.2 15.1.3
Approximation by
Distribution
MCMC in BUGS
15.1.4
Transformations 15.2
Implementation in BUGS
15.3
15.4
Summary
RCode 15.4.1
409
15.4.2
15.5
Exercises
CHAPTER 16
The Hierarchical Model and BUGS Code The Posterior: How Big Is the Slope? Posterior Prediction
16.2 16.3
430
16.4
Summary
RCode
16.5.1 16.5.2
16.5
437
BRugs: Robust Linear Regression BRugs: Simple Linear Regression with Repeated Measures
439
16.5.3
442 446
16.6
Exercises
CHAPTER 17
453 454
454
458
17.1.3
17.1.4 17.2
The Posterior: How Big Are the Slopes? Posterior Prediction and
460 462
Hyperpriors
Coefficients
17.2.1
Shrinkage
of Regression 463
Interpreting
the Posterior
17.4 17.5
478
Coefficients
483 488
17.6
Exercises
CHAPTER 18
491
492 493 495 497
Doing
18.1.3
A Worked Example
18.2
18.3
502
506 507
18.4
RCode
18.4.1
507 512
18.5 CHAPTER 19
Exercises
515
Multifactor ANOVA 516 517 519 520 522
Bayesian
19.1.1
Rescaling,
and 528
Homogeneous
19.2
Variances
a.k.a,
Within-Subject
531
533
Why Use
Why Not?
19.3
R Code
535
535
Exercises
544 549
550 551 553 553 555 556 556 556 557
561
Logistic Regression
20.1.1 20.1.2 20.1.3 20.1.4 20.1.5 20.1.6 The Model
Hyperprior
ANOVA
Across
Regression Coefficients
20.2 20.3
Interaction of Predictors in
Logistic Regression
Logistic
20.3.1
Within-Subject Designs
20.4 20.5
Summary
RCode 20.5.1 20.5.2
561 562
562 567
20.6
Exercises
572
CHAPTER 21
575
576 576 to Ordinal y 577 578 579 580 581
21.1.2
21.1.3 21.1.4
21.1.5
21.2
Some Examples
21.2.1
21.3
21.4
Interaction
Relation to Linear and
588
Logistic Regression
Contingency
22.1 22.1.1 22.1.2
Analysis
597
Poisson Exponential ANOVA What the Data Look Like The Exponential Link Function
598
598 599
Examples
22.2.1 Credible Intervals
on
Cell Probabilities
Contingency Tables
CHAPTER 23
619
620 620
621 622
Reporting
23.1.1 23.1.2
23.1.3
Bayesian Analysis
Points
Essential Points
Optional Helpful
Points
23.2 23.3
Thinning
623
Computing Computing
Approximation
23.3.2 R Code for
Computing
HDI of a Function
629
630
631
Examples Reparameterization
of Two Parameters
632
REFERENCES INDEX
633
639