Welcome to this book and to this course! Before we start exploring R and the essentials of data science from a tidyverse perspective, this introductory chapter provides the current course coordinates, clarifies its contents and key concepts (e.g., the relation between data science and statistics), spells out background assumptions and constraints, and provides pointers to required software and additional resources.
The materials in this book support the following course:
- PSY-15150, at the University of Konstanz
by Hansjörg Neth (email@example.com, SPDS, office D507).
- Winter 2020: Mondays, 15:15–16:45, R513.
- Course materials:
- Online platforms (at uni.kn):
Data analysis in psychology has a flavor of its own
— but one much more due to psychologists than to their science.
John W. Tukey (1969, p. 83)
The book and course Data Science for Psychologists provides an introduction to data science in R and conveys fundamental skills of data literacy and conducting reproducible research. The curriculum is tailored to the needs of psychologists, but is also suited for students of the humanities and other biological or social sciences. It is targeted at advanced undergraduate students and structured into four parts:
Introducing key concepts and commands of the R programming language for statistical computing (R Core Team, 2020).1 This includes working with the RStudio environment and creating reproducible research documents with R Markdown.
Exploring, transforming, and visualizing data. Learning to clean, wrangle, and summarize data involves key tools of the so-called tidyverse (Wickham, Averick, et al., 2019), including the R packages dplyr, ggplot2, tibble, and tidyr.
Gaining a deeper understanding of some important data types (e.g., acquiring the skills and tools for handling text and time-related data).
Providing a glimpse on elementary concepts of computer programming (including functions, conditionals, and iterative execution).
Working through this book enables students to analyze, summarize, and understand data in a variety of ways. Importantly, our main focus is on making sense of data — by exploring, transforming, and visualizing it — rather than statistical testing or computer programming.
The course textbook (available at https://bookdown.org/hneth/ds4psy/) contains engaging examples from the behavioral sciences and is supported by the R package ds4psy (Neth, 2020) that provides datasets and functions for data generation and manipulation. A large number of exercises and solutions allow students to check their understanding, monitor their progress, and practice their skills.
Students of psychology and other social sciences are trained to analyze data. But the data they learn to work with (e.g., in courses on statistics and empirical research methods) is typically provided to them and structured in a — mostly rectangular and often tidy (Wickham, 2014b) — format that includes and presupposes many steps of data processing regarding the aggregation and spatial layout of variables. When beginning to collect data from real sources, most students struggle with these pre-processing steps which — even for experienced data scientists — tend to require more time and effort than choosing and conducting statistical tests. This course develops the foundations of data analysis that allow students to collect data from real-world sources and transform such data into a shape that allows conducting reproducible research and answering scientific questions.
While there are many good introductions to data science — like R for Data Science (Wickham & Grolemund, 2017) — they typically do not cater towards the special background and needs — and often anxieties and reservations — of psychology students. As social scientists are not computer scientists, we introduce new concepts and commands without assuming a mathematical or computational background. Our data and examples typically involve people and questions currently of interest in scientific psychology. Adopting a task-oriented perspective, we begin with a specific problem and then solve it with some combination of data collection, manipulation, modeling, and visualization.
Our main goal is to develop useful skills for understanding and dealing with real-world data. Upon completing this course, its students will be able to read, transform, analyze, and visualize data of different types using a variety of tools. While this course does not deal with statistical testing and only scratches the surface of computer programming, it teaches reproducible research practices and covers fundamental knowledge and skills of data science.
This book is targeted at advanced undergraduate students (close to completing their BSc thesis) in psychology, the humanities, or related sciences. This audience typically has a basic familiarity with quantitative research methods, but little or no background in computer programming.
Key elements for succeeding in this course are a curiosity in making sense of data and a motivation for regular readings and exercises (see clarifications below).
Regular course attendance and preparation (by working through the current chapter before each session), solving and submitting weekly programming assignments, and succeeding in a final exam OR data science project.
Some basic familiarity with statistics and R is beneficial, but enthusiastic novices are also welcome.
Student performance is evaluated on the basis of two components:
A. Solutions to weekly programming assignments: To be submitted (on Ilias) by Thursday of the same week (by 23:59) on at least 10 out of 12 weeks.
B. Final assessment:
- Final exam (90 mins, open book); or
- Data science project: See Appendix C for guidelines and scope. (Final projects can be thesis-related; contents to be discussed with instructor.)2
Final grades are based on course participation (including regular submission of exercises) (A: 33%) and the final exam/project (B: 67%).
Neth, H. (2020). ds4psy: Data science for psychologists. Retrieved from https://CRAN.R-project.org/package=ds4psy
R Core Team. (2020). R base: A language and environment for statistical computing. Retrieved from https://www.R-project.org
Tukey, J. W. (1969). Analyzing data: Sanctification or detective work. American Psychologist, 2, 83–91. https://doi.org/10.1037/h0027108
Wickham, H. (2014b). Tidy data. Journal of Statistical Software, 59(10), 1–23. https://doi.org/10.18637/jss.v059.i10
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L. D., François, R., … Yutani, H. (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686. https://doi.org/10.21105/joss.01686
Wickham, H., & Grolemund, G. (2017). R for data science: Import, tidy, transform, visualize, and model data. Retrieved from http://r4ds.had.co.nz
A few years ago, a course like this would first justify its use of R by its availability, flexibility, and increasing popularity. Today, R and the buzzwords data literacy and data science are so popular that we can skip this part. In fact, not using R or not knowing about data science would increasingly call for an explanation.↩
Data science project are to be completed and submitted by Monday, March 1, 2021.↩