class: center, middle, inverse, title-slide #
Semester 2 Introduction
## Data Analysis for Psychology in R 2
### dapR2 Team ### Department of Psychology
The University of Edinburgh ### AY 2020-2021 --- # What we have covered so far... --- # Aims for semester 2 1. Discuss analysis of experimental designs using linear model. + Models with multiple nominal categorical variables. + Overall effects as well as comparisons between levels. + Categorical interactions -- 2. Recap assumption and diagnostics -- 3. Discuss ways to conduct inferential tests with violated assumptions (bootstrapping) -- 4. Extend to linear models to include other types of dependent variale (binary, categorical) -- 5. Discuss a number of important modelling and inference topics + Missing data + Multiple comparisons + Power analysis -- 6. Draw all of this together and emphasize the skills we have been developing in the context of reproducible analysis and science. --- # Key concepts from semester 1 1. Basic structure of the linear model: $$ y_i = b_0 + b_1x_1 + b_2x_2 ...b_kx_k + \epsilon_i $$ + And in R: ```r lm(y ~ x1 + x2 + x3, data = tibble) ``` + From which we have: + Individual tests of `\(\beta\)` coefficients + `\(F\)`-tests of overall model + `\(R^2\)` estimating variance accounted for --- # Key concepts from semester 1 2. Assumptions + **L**inearity: The relationship between `\(y\)` and `\(x\)` is linear. + **I**ndependence of errors: The error terms should be independent from one another. + **N**ormality: The errors `\(\epsilon\)` are normally distributed + **E**qual variances ("Homoscedasticity"): The scale of the variability of the errors `\(\epsilon\)` is constant at all values of `\(x\)`. --- # Key concepts from semester 1 3. Interactions + We have looked at interactions between two numeric/continuous variables, and between a categorical and numeric variable. + When the effect of one variable changes as a function of another. + We can explore these visually + Calculate simple slopes (the effect of `\(x\)` at a specific value of `\(z\)`) --- # Key concepts from semester 1 4. Model comparisons + When we have two nested models, we can compute an incremental `\(f\)`-test that tells us the improvement in the model for the inclusion of a (set) of variables. --- # Semester plan + Weeks 1 to 5 + Recap experimental designs and the types of data they produce + Discuss analysis for different types of design, linking linear models to ANOVA. + Introduce categorical interactions + Discuss assumptions and multiple comparisons -- + Weeks 7 to 11 + Bootstrapping + Binary logistic regression + Multinomial regression & generalized linear model + Missing data (conceptual) + Power Analysis + Reproducibility --- # Weekly material 1. Lectures -- 2. Lecture exercises -- 3. Practical exercises -- 4. Reading --- # Weekly support + "Live R" and Q&A -- + Lab drop-in (new format) -- + Office hours (new time for Tom) -- + Study groups (still live, not used in S1) -- + Discussion boards (new format) --- # Assessments + Weekly quizzes (10 more in weeks 1 5, 7 to 11) + Report 2 + Second half of the semester. + Format near identical to semester 1 --- class: center, middle # Let's get to it!