Learning Statistics with R

Part 1: Background
 Chapter 1: Why do we learn statistics? Psychology and statistics. Statistics in everyday life. Some examples where intuition is misleading, and statistics is critical.
 Chapter 2: A brief introduction to research design Basics of psychological measurement. Reliability and validity of a measurement. Experimental and nonexperimental design. Predictors versus outcomes.
Part 2: An Introduction to R
 Chapter 3: Getting started with R. Getting R and Rstudio. Typing commands at the console. Simple calculations. Using functions. Introduction to variables. Numeric, character and logical data. Storing multiple values asa vector.
 Chapter 4: Additional R concepts. Installing and loading packages. The workspace. Navigating the file system. More complicated data structures: factors, data frames, lists and formulas. A brief discussion of generic functions.
Part 3: Working with Data
 Chapter 5: Descriptive statistics. Mean, median and mode. Range, interquartile range and standard deviations. Skew and kurtosis. Standard scores. Correlations. Tools for computing these things in R. Brief comments missing data.
 Chapter 6: Drawing graphs. Discussion of R graphics. Histograms. Stem and leaf plots. Boxplots. Scatterplots. Bar graphs.
 Chapter 7: Pragmatic matters. Tabulating data. Transforming a variable. Subsetting vectors and data frames. Sorting, transposing and merging data. Reshaping a data frame. Basics of text processing. Reading unusual data files. Basics of variable coercion. Even more data structures. Other miscellaneous topics, including floating point arithmetic.
 Chapter 8: Basic programming. Scripts. Loops. Conditionals. Writing functions. Implicit loops.
Part 4: Statistical Theory
 Chapter 9: Introduction to probability. Probability versus statistics. Basics of probability theory. Common distributions: normal, binomial, t, chisquare, F. Bayesian versus frequentist probability.
 Chapter 10: Estimating population parameters from a sample. Sampling from populations. Estimating population means and standard deviations. Sampling distributions. The central limit theorem. Confidence intervals.
 Chapter 11: Hypothesis testing. Research hypotheses versus statistical hypotheses. Null versus alternative hypotheses. Type I and Type II errors. Sampling distributions for test statistics. Hypothesis testing as decision making. pvalues. Reporting the results of a test. Effect size and power. Controversies and traps in hypothesis testing.
Part 5: Statistical Tools
 Chapter 12: Categorical data analysis. Chisquare goodness of fit test. Chisquare test of independence. Yate's continuity correction. Effect size with Cramer's V. Assumptions of the tests. Other tests: Fisher exact test and McNemar's test.
 Chapter 13: Comparing two means. One sample ztest. One sample ttest. Student's independent sample ttest. Welch's independent samples ttest. Paired sample ttest. Effect size with Cohen's d. Checking the normality assumption. Wilcoxon tests for nonnormal data.
 Chapter 14: Comparing several means (oneway ANOVA). Introduction to oneway ANOVA. Doing it in R. Effect size with etasquared. Simple corrections for multiple comparisons (post hoc tests). Assumptions of oneway ANOVA. Checking homogeneity of variance using Levene tests. Avoiding the homogeneity of variance assumption. Checking and avoiding the normality assumption. Relationship between ANOVA and ttests.
 Chapter 15: Linear regression. Introduction to regression. Estimation by least squares. Multiple regression models. Measuring the fit of a regression model. Hypothesis tests for regression models. Standardised regression coefficient. Assumptions of regression models. Basic regression diagnostics. Model selection methods for regression.
 Chapter 16: Factorial ANOVA. Factorial ANOVA without interactions. Factorial ANOVA with interactions. Effect sizes, estimated marginal means, confidence intervals for effects. Assumption checking. Ftests as model selection. Interpreting ANOVA as a linear model. Specifying contrasts. Post hoc testing via Tukey's HSD. Factorial ANOVA with unbalanced data (Type I, III and III sums of squares)
Wrap Up
 Chapter 17: Epilogue. Comments on the content missing from this book. Advantages to using R.
 References. Massively incomplete reference list.
The list below contains links to all of the data files referred to in the book. There are a few data sets that are new to version 0.4 that weren't in version 0.3.1, and some of the data sets from version 0.3.1 have been dropped in version 0.4. You can also download a zip file containing all of the R data files.
The book is associated with the lsr package available on CRAN. The source code for the package is available on bitbucket.
In late 2013 I gave a oneday workshop out at CSIRO that aimed to provide a brief introduction to R for an audience who knew statistics but not R. The workshop consisted of two distinct parts, an introduction to the basic mechanics of R, followed by a fairly rapid coverage of a lot of core statistical tools in R. (There's also a bonus "Part 3" that covers a few additional topics that I'm fond of). Anyway, given that the University owns the IP associated with the workshop, and with the agreement of both CSIRO and the University, I've posted copies of all the slides, the exercises and the solution sets to the exercises.
I also had the presence of mind to record screencasts of my practice talk, so there's about 5 hours of me talking about statistics linked to below! Two warnings about the videos. Firstly, they were practice talks, and so my delivery isn't as smooth as I'd have liked Secondly, I've only just started learning about recording video, so the quality of the audio leaves a lot to be desired (in hindsight, I should have invested in a USB mike). I haven't made any attempt to edit either. I've posted them because they might be useful to people, but don't get too excited! There's a lot of flaws in how they're put together. On the other hand, they're free.
Part 1: Introducing R
 Getting Started. About R and Rstudio. Typing commands at the console. Arithmetic operators. Logical operators. Functions. Getting help. [slides] [exercises] [solution set] [mp4: 328Mb, 34min]
 Variables and the R Workspace. Creating variables. Numeric, character and logical data. Vectors. Data frames. Indexing and subsetting. Factors. Lists. Matrices. The R workspace. [slides] [exercises] [solution set] [mp4: 565Mb, 46min]
 Some Important Practical Matters. Installing and loading packages. Loading a workspace file. Saving a workspace file. Importing a CSV file. Scripts. The working directory. [slides] [exercises] [solution set] [mp4: 870Mb, 50min]
Part 2: Introductory Statistics in R
 Descriptive Statistics. Central tendency, spread, higher moments. Frequency tables. Describe and summary. Correlations. Descriptive statistics by group. [slides] [exercises] [solution set] [mp4: 490Mb, 32min]
 Statistical Graphics. Scatter plots. Box plots. Histograms. Bar plots. Bar graphs of means and confidence intervals. Line plots [slides] [exercises] [solution set] [mp4: 327Mb, 27min]
 Simple Inferential Statistics. Confidence intervals. ttests. Wilcoxon tests. chisquare tests. Fisher exact test. Correlation tests. Effect sizes [slides] [exercises] [solution set] [mp4: 403Mb, 25min]
 Linear Models. Multiple regression. Oneway and factorial ANOVA. Effect sizes and post hoc tests. Hierarchical regression. ANCOVA. Repeated measures ANOVA. [slides] [exercises] [solution set] [mp4: 383Mb, 32min]
 A Few Data Manipulation Tricks. Reshaping data from long to wide and back again. Coercion. Cutting variables into categories. Permuting factor levels [slides] [exercises] [solution set] [mp4: 189Mb, 16mins]
Part 3: Extras
 Additional Statistical Tools. General linear model. Factor analysis. Scale reliability. Bayesian methods. [slides] [mp4: 190Mb, 15min]
 A Few More R Tricks. Writing functions. Ifelse. For loops. R Markdown. Text processing. [slides] [mp4: 171Mb, 15min]