Preface |
|
iii | |
Acknowledgements |
|
iv | |
|
|
1 | (11) |
|
1.1 Conventions used in this book |
|
|
1 | (1) |
|
1.2 How this book is organised |
|
|
2 | (1) |
|
|
2 | (2) |
|
1.4 FAIR and data repositories |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
1.7 Learning through real datasets |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
1.10 Internal help system |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
10 | (2) |
|
|
12 | (9) |
|
|
12 | (2) |
|
|
14 | (1) |
|
2.3 Where to find packages? |
|
|
15 | (1) |
|
2.4 How to learn about package functions and datasets? |
|
|
16 | (1) |
|
|
17 | (1) |
|
2.6 Examining installed packages |
|
|
17 | (2) |
|
2.7 Leam R with swirl and other tools |
|
|
19 | (2) |
|
|
21 | (22) |
|
|
21 | (1) |
|
3.2 Functions and arguments |
|
|
21 | (2) |
|
3.3 Creating vectors and dataframes |
|
|
23 | (4) |
|
|
27 | (1) |
|
3.5 Warning: quotation marks come in many styles |
|
|
28 | (1) |
|
|
29 | (3) |
|
3.7 Selecting parts of a dataframe |
|
|
32 | (1) |
|
|
32 | (1) |
|
3.9 Loading data--read.csv() |
|
|
33 | (2) |
|
|
35 | (3) |
|
3.11 Saving objects as Rdata |
|
|
38 | (1) |
|
3.12 Instaling the tidy verse |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
41 | (1) |
|
3.15 Functions used in this chapter |
|
|
42 | (1) |
|
|
43 | (9) |
|
|
43 | (1) |
|
|
44 | (4) |
|
|
48 | (1) |
|
|
49 | (2) |
|
4.5 r4psych and datsets for this book |
|
|
51 | (1) |
|
|
52 | (17) |
|
5.1 Downloading data from figshare |
|
|
52 | (1) |
|
5.2 Loading dataset from multi-sheet Excel files |
|
|
52 | (3) |
|
|
55 | (1) |
|
|
56 | (1) |
|
5.5 Factors--adding labels |
|
|
57 | (2) |
|
5.6 Reading new sheets from Excel file |
|
|
59 | (4) |
|
5.7 Renaming multiple variables |
|
|
63 | (1) |
|
|
64 | (1) |
|
5.9 Counting cases, calculating means, sd and proportions |
|
|
65 | (1) |
|
|
66 | (1) |
|
5.11 Automatically renaming variables |
|
|
66 | (2) |
|
5.12 Functions used in this chapter |
|
|
68 | (1) |
|
|
69 | (8) |
|
6.1 Loading comma-separated value (csv) files |
|
|
69 | (1) |
|
6.2 Female psychosis dataset |
|
|
70 | (1) |
|
6.3 Checking the data types |
|
|
71 | (1) |
|
|
72 | (2) |
|
6.5 Counting missing values |
|
|
74 | (1) |
|
6.6 Converting multiple variables to numeric types |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
75 | (1) |
|
6.9 Functions used in this chapter |
|
|
75 | (2) |
|
|
77 | (8) |
|
7.1 Loading SPSS files--.SAV |
|
|
77 | (1) |
|
|
78 | (1) |
|
7.3 The structure of "labelled" variables |
|
|
79 | (1) |
|
7.4 Factors, adding levels and labels |
|
|
80 | (1) |
|
|
81 | (1) |
|
7.6 Removing attributes from multiple variables |
|
|
82 | (1) |
|
|
83 | (1) |
|
7.8 Functions used in this chapter |
|
|
84 | (1) |
|
8 Coding New Variables and Scale Reliability |
|
|
85 | (24) |
|
|
85 | (1) |
|
8.2 Dataset: Branjerdporn et al. (2019) |
|
|
85 | (2) |
|
8.3 Adding values with mutate() |
|
|
87 | (1) |
|
8.4 Using sum() in mutate() |
|
|
88 | (2) |
|
8.5 Numeric scales with reverse scoring--scoreItems() |
|
|
90 | (5) |
|
8.6 Psychometric properties--scoreItems() |
|
|
95 | (1) |
|
8.7 Converting text responses to numeric values |
|
|
96 | (1) |
|
8.8 Factor levels to recode variables |
|
|
97 | (1) |
|
8.9 mutate() without naming variables (anonymous functions) |
|
|
98 | (2) |
|
8.10 mutate() with function() on real data |
|
|
100 | (2) |
|
8.11 Calculate subscale and total scores |
|
|
102 | (1) |
|
8.12 Creating categorical variables from continuous scales |
|
|
102 | (2) |
|
|
104 | (1) |
|
|
105 | (1) |
|
8.15 Impact of item deletion on item--whole scale correlation |
|
|
106 | (1) |
|
8.16 Inter-Item Correlation Matrix |
|
|
107 | (1) |
|
8.17 Functions used in this chapter |
|
|
108 | (1) |
|
|
109 | (16) |
|
|
109 | (1) |
|
9.2 The importance of a normal distribution |
|
|
109 | (1) |
|
9.3 Creating a normal distribution |
|
|
110 | (1) |
|
9.4 Density plot of a normal distribution |
|
|
111 | (1) |
|
|
111 | (2) |
|
9.6 Skewness and Kurtosis |
|
|
113 | (1) |
|
|
114 | (1) |
|
9.8 Empirical distributions--checking normality |
|
|
114 | (1) |
|
9.9 Taking small samples of data |
|
|
114 | (1) |
|
9.10 Histogram, qqplot, skewness and kurtosis with real data |
|
|
115 | (1) |
|
9.11 Sub-samples and distributions |
|
|
116 | (3) |
|
9.12 Sidebar: objects in R |
|
|
119 | (3) |
|
9.13 Severe deviations from normality |
|
|
122 | (1) |
|
|
123 | (1) |
|
9.15 Functions used in this chapter |
|
|
123 | (2) |
|
|
125 | (8) |
|
10.1 Reload data--Larson et al. (2015) |
|
|
125 | (1) |
|
|
125 | (2) |
|
10.3 Outlier--numeric methods |
|
|
127 | (2) |
|
|
129 | (3) |
|
10.5 Functions used in this chapter |
|
|
132 | (1) |
|
11 Descriptive Statistics |
|
|
133 | (8) |
|
|
133 | (1) |
|
11.2 Multiple grouping variables |
|
|
134 | (1) |
|
|
135 | (1) |
|
|
136 | (1) |
|
11.5 t-test--using indexing |
|
|
136 | (2) |
|
11.6 t-test using formula |
|
|
138 | (1) |
|
11.7 Boxplots using formula |
|
|
139 | (1) |
|
11.8 Boxplot with two IVs |
|
|
139 | (1) |
|
11.9 Functions used in this chapter |
|
|
140 | (1) |
|
|
141 | (16) |
|
12.1 Introduction to graphing |
|
|
141 | (1) |
|
12.2 Structure of a ggplot() call |
|
|
142 | (1) |
|
|
143 | (1) |
|
|
143 | (1) |
|
|
144 | (1) |
|
|
145 | (2) |
|
12.7 Combining multiple layers |
|
|
147 | (1) |
|
|
148 | (1) |
|
12.9 Saving data objects, then plotting |
|
|
149 | (1) |
|
|
150 | (3) |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (1) |
|
12.14 Functions used in this chapter |
|
|
156 | (1) |
|
13 Correlation--Bivariate |
|
|
157 | (14) |
|
|
157 | (1) |
|
|
157 | (2) |
|
13.3 Scatterplot--ggplot2 |
|
|
159 | (2) |
|
13.4 Correlation coefficient |
|
|
161 | (1) |
|
|
161 | (1) |
|
13.6 Coefficient of determination |
|
|
162 | (1) |
|
13.7 Correlation Matrix--association between multiple variables |
|
|
162 | (1) |
|
13.8 Plotting multiple correlations--corrplot |
|
|
163 | (1) |
|
13.9 Plotting multiple correlations--GGally |
|
|
164 | (1) |
|
13.10 Statistical significance in a correlation matrix |
|
|
165 | (2) |
|
13.11 Assumptions of correlation |
|
|
167 | (3) |
|
13.12 Functions used in this chapter |
|
|
170 | (1) |
|
|
171 | (9) |
|
14.1 Spurious correlation |
|
|
171 | (1) |
|
|
172 | (5) |
|
14.3 Partial correlation with correlation() |
|
|
177 | (2) |
|
14.4 Functions used in this chapter |
|
|
179 | (1) |
|
15 One-Way ANOVA--Model Data |
|
|
180 | (12) |
|
|
180 | (1) |
|
15.2 ANOVA--organising the data |
|
|
180 | (3) |
|
15.3 ANOVA formula--Base R-aov() |
|
|
183 | (1) |
|
15.4 Effect size--eta-squared |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
185 | (1) |
|
15.7 Post hoc tests--Tukey HSD |
|
|
186 | (1) |
|
|
187 | (2) |
|
15.9 Checking the assumptions |
|
|
189 | (1) |
|
|
190 | (1) |
|
15.11 Functions used in this chapter |
|
|
191 | (1) |
|
16 One-Way ANOVA--Real Data |
|
|
192 | (5) |
|
|
192 | (1) |
|
16.2 Visualising group differences |
|
|
192 | (1) |
|
|
193 | (2) |
|
16.4 Post hoc tests: TukeyHSD() |
|
|
195 | (1) |
|
16.5 Functions used in this chapter |
|
|
195 | (2) |
|
|
197 | (12) |
|
|
197 | (1) |
|
17.2 Dataset--Reillyetal. 2016 |
|
|
197 | (2) |
|
17.3 Distribution of participants across factor categories |
|
|
199 | (3) |
|
17.4 Unbalanced factorial ANOVA |
|
|
202 | (2) |
|
|
204 | (1) |
|
17.6 Planned comparisons with emmeans() |
|
|
205 | (2) |
|
17.7 Functions used in this chapter |
|
|
207 | (2) |
|
|
209 | (10) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
211 | (1) |
|
|
211 | (1) |
|
18.5 Checking assumptions in van der Velde et al. (2015) |
|
|
212 | (3) |
|
18.6 Setting contrast types |
|
|
215 | (1) |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
216 | (2) |
|
18.10 Functions used in this chapter |
|
|
218 | (1) |
|
19 Repeated Measures ANOVA |
|
|
219 | (14) |
|
19.1 Repeated measures study--Edwards et al. (2015) |
|
|
219 | (1) |
|
|
220 | (1) |
|
|
221 | (1) |
|
19.4 Reorganising data into long format |
|
|
222 | (1) |
|
19.5 Joining the datasets |
|
|
223 | (1) |
|
|
224 | (2) |
|
19.7 Sphericity and correction |
|
|
226 | (1) |
|
19.8 Repeated-measures ANOVA--accuracy |
|
|
226 | (1) |
|
19.9 Interpreting the results--accuracy |
|
|
227 | (2) |
|
19.10 Repeated-measures ANOVA-reaction time |
|
|
229 | (1) |
|
19.11 Interpreting the results--reaction time |
|
|
230 | (1) |
|
19.12 Applying the Greenhouse-Geisser correction |
|
|
231 | (1) |
|
19.13 Functions used in this chapter |
|
|
232 | (1) |
|
|
233 | (15) |
|
20.1 Introduction to regression |
|
|
233 | (1) |
|
20.2 Simple regression with toy data |
|
|
233 | (4) |
|
|
237 | (1) |
|
|
238 | (1) |
|
|
239 | (1) |
|
20.6 Standardizing variables |
|
|
240 | (1) |
|
|
241 | (1) |
|
20.8 Load data for regression |
|
|
241 | (1) |
|
20.9 Simple regression from Palseretal. (2018) |
|
|
242 | (1) |
|
20.10 Checking regression assumptions |
|
|
243 | (3) |
|
|
246 | (1) |
|
20.12 Functions used in this chapter |
|
|
246 | (2) |
|
|
248 | (12) |
|
21.1 Using non-parametric tests |
|
|
248 | (1) |
|
21.2 Gysin-Maillart et al. (2016) non-parametric data |
|
|
248 | (2) |
|
|
250 | (2) |
|
21.4 T-test and Wilcoxon rank-sum test |
|
|
252 | (2) |
|
21.5 Effect size for Wilcoxon rank-sum test |
|
|
254 | (1) |
|
21.6 Kruskal-Wallis rank test |
|
|
255 | (3) |
|
21.7 Effect size for Kruskal-Wallis rank test |
|
|
258 | (1) |
|
21.8 Post-hoc tests for Kruskal-Wallis |
|
|
258 | (1) |
|
21.9 Functions used in this chapter |
|
|
259 | (1) |
|
22 Categorical Data Analysis |
|
|
260 | (4) |
|
|
260 | (1) |
|
22.2 Chi-squared test--with variables |
|
|
260 | (1) |
|
22.3 Chi-squared test--with count values |
|
|
261 | (1) |
|
22.4 Visualising categorical data |
|
|
262 | (1) |
|
22.5 Functions used in this chapter |
|
|
263 | (1) |
|
|
264 | (4) |
|
|
264 | (1) |
|
23.2 Bootstrapping and resampling |
|
|
264 | (1) |
|
|
265 | (1) |
|
|
265 | (1) |
|
23.5 Meta-analysis and systematic review |
|
|
265 | (1) |
|
23.6 Missing data and imputation |
|
|
266 | (1) |
|
|
266 | (1) |
|
|
266 | (1) |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
268 | (21) |
|
|
268 | (1) |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
272 | (1) |
|
|
272 | (1) |
|
|
273 | (1) |
|
|
273 | (2) |
|
|
275 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
|
277 | (1) |
|
|
278 | (1) |
|
|
279 | (1) |
|
|
279 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
|
281 | (1) |
|
|
282 | (1) |
|
|
282 | (1) |
|
|
283 | (1) |
|
|
283 | (2) |
|
|
285 | (1) |
|
|
285 | (1) |
|
|
286 | (2) |
|
|
288 | (1) |
|
|
288 | (1) |
|
|
288 | (1) |
References |
|
289 | (8) |
Index |
|
297 | |