R101: A practical guide to using R

Between 2016 and 2019, I taught an introductory course in R for psychologists, sociologists, and other social scientists at Masaryk University. After four iterations, I decided to turn materials developed in the course into a self-paced introduction to R.

Although anyone can make use of these materials, I believe that those who could benefit the most are students/graduates from fields such as psychology, sociology, or political science. This conclusion stems from knowing my own background and the original target group of the course. I was trained to use IBM SPSS for doing statistical analysis in research, be it descriptive statistics using box-plots or multivariate techniques like linear mixed models. After being able to translate these skills into R, was asked to show a way to others with a similar background.

Currently, the materials are accessible as individual R notebooks - commentary along with demonstrations of the respective code. In the future, I am going to turn the content in a handbook. That being said, enjoy the journey!

Course characteristic

This course has three main goals. The first is to eliminate dependence on paid statistical software, which may be unavailable for financial reasons and which provides the user with relatively limited work options.

Secondly, this course aims to promote interest in R as the programming language with (almost) endless analytical possibilities and vibrant global community.

Last but not least, I would like you to have fun. Learning something like doing data analysis in R may not be easy. However, it could be quite enjoyable too. I admire Andy Field for his humorous, yet comprehensive way of teaching complex abstract topics such as factor rotation. My humble aspiration is to make learning R joyful, even if for a bit.

So, what exactly can you expect?

Covered topics

01. PROGRAMMING LANGUAGE R
  1. Conceptual introduction to R
  2. Installing R and RStudio, an introduction to the environment, packages
  3. Fundamentals – using R as a calculator, assigning values to objects, objects classes
  4. Coding etiquette

Additional materials:

02. DATA OBJECTS AND CLASSES
  1. Vector
  2. Matrix
  3. Factors
  4. Data Frames
  5. Lists

Additional materials:

  • Muenchen, R. A. (2011). R for SAS and SPSS Users. Springer: New York.
  • Navarro, D. J. (2014). Learning statistics with R: A tutorial for psychology students and other beginners. Available online: http://www.fon.hum.uva.nl/paul/lot2015/Navarro2014.pdf
  • Norman, M. (2011). The Art of R Programming. No Starch Press: San Francisco.
03. IMPORTING DATA
  1. .csv
  2. .txt
  3. .xlsx
  4. .sav

Additional materials:

04. CLEANING DATA
  1. Messy data, tidy data
  2. Date and time, strings
  3. Missing values, outliers, errors

Additional materials:

  • Muenchen, R. A. (2011). R for SAS and SPSS Users. Springer: New York.
  • Navarro, D. J. (2014). Learning statistics with R: A tutorial for psychology students and other beginners. Available online: http://www.fon.hum.uva.nl/paul/lot2015/Navarro2014.pdf
  • Norman, M. (2011). The Art of R Programming. No Starch Press: San Francisco.
05. WRANGLING DATA (TIDYVERSE)
  1. tbl
  2. select, mutate
  3. filter, arrange
  4. summarise, %>%
  5. group_by

Additional materials:

06. EXPLORING DATA
  1. Categorical data
  2. Continuous data

Additional materials:

  • Muenchen, R. A. (2011). R for SAS and SPSS Users. Springer: New York.
  • Navarro, D. J. (2014). Learning statistics with R: A tutorial for psychology students and other beginners. Available online: http://www.fon.hum.uva.nl/paul/lot2015/Navarro2014.pdf
  • Norman, M. (2011). The Art of R Programming. No Starch Press: San Francisco.
07. VISUALISATIONS
  1. Bar chart
  2. Histogram
  3. Boxplot
  4. Error bar
  5. Scatterplot
  6. Pirate plot

Additional materials:

08. GROUP COMPARISONS
  1. t-test (one-sample, two independent and two dependent samples), Student’s and Welch’s t-test
  2. ANalysis Of VAriance (ANOVA)

Additional materials:

09. CORRELATION, LINEAR REGRESSION
  1. Correlation (Pearson’s r, Spearman’s rho, Kendall’s tau)
  2. Linear regression

Additional materials:

10. MLR AND LOGISTIC REGRESSION
  1. Multiple linear regression
  2. Logistic regression

Additional materials:

  • Field, A., Miles, J., & Field, Z. (2012). Discovering Statistics Using R. Sage: UK.
  • Navarro, D. J. (2014). Learning statistics with R: A tutorial for psychology students and other beginners. Available online: http://www.fon.hum.uva.nl/paul/lot2015/Navarro2014.pdf
  • Verzani, J. (2014). Using R for Introductory Statistics (2. edice). Chapman & Hall: Boca Raton
11. MULTILEVEL AND MIXED MODELS
  1. Introduction to multilevel and mixed models
  2. Linear mixed-effect models
  3. Generalized linear mixed-effect models
  4. Repeated Measures

Additional materials:

  • Field, A., Miles, J., & Field, Z. (2012). Discovering Statistics Using R. Sage: UK.

Go back