Using fancy tools like neural nets, boosting, and support vector machines without understanding basic statistics is like doing brain surgery before knowing how to use a band-aid.
(Wasserman, 2004, p. vii/viii)
This book neither covers machine learning nor does it teach statistics. Instead, it provides a foundation for dealing with data in scientific psychology and related contexts. While it is possible to study statistics as a mathematical discipline, actually using data for answering real-world questions (i.e., collecting, transforming, and evaluating data) requires all of the methods and skills introduced here.
When first starting to teach this material (in 2016), I elaborated upon chapters of R for Data Science (Wickham & Grolemund, 2017). As most of my students have no programming background, they struggled with this text and were confused by the mix of base R and tidyverse concepts. Hence, I began selecting and summarizing essential topics and tailored my examples and exercises to the needs of students in psychology and social sciences. To provide some foundations beyond the tidyverse, I added base R sections to complement the perspective embraced by my original source. By now, most chapters here contain a mix of summaries and new materials, and can be studied independently or as parts of a larger curriculum.
This book allows teaching a variety of introductory courses on data science for students of psychology and related fields. The term data science here is mainly a place holder for “methods, skills, and tools dealing with data”. As this book focuses on the basics (i.e., data types and shapes, and ways of loading, transforming, summarizing, and visualizing data), it does not cover topics like machine learning, modeling, or statistics. This may initially disappoint some students, but the above quote by Wasserman (2004) also applies to these applications: When other introductory texts promise them, they rarely deliver a sound introduction that is suited to novices. And whoever aims to develop statistical models or advance machine learning first must possess a solid understanding of the basics to successfully venture into new territory.
The chapters of this book can be arranged into a variety of courses. Depending on your goals, student needs, and the length of the teaching period, some of the more specialized topics (e.g., Chapter 9 on Strings of text, Chapter 10 on Dates and times, or Appendix E on regular expressions) can be skipped, or used as the basis of a more advanced curriculum. Similarly, combining the chapters of Part I and Part IV with some appendices (e.g., Appendix D on using colors in R and Appendix F on using R Markdown) provides a general introduction to data literacy and reproducible research in R, without focusing on particular packages or data wrangling tasks. More specialized courses on statistics or modeling could only use Chapter 1 to introduce Basic R concepts and commands.
The book was conceived with psychologists in mind, but its materials and examples hope to engage students and researchers from various backgrounds and invite them to apply computational tools to solve challenging problems in their fields. Hopefully, readers will welcome the numerous summaries, cross-references, and links to further resources, and find the large number of practice tasks and exercises entertaining and enlightening.
As data science is a dynamic field and this text is being revised on a regular basis, it is likely that the current version contains some typos and mistakes.
Please feel free to contact me (as
uni.kn) to report errors, possible improvements, or any other feedback or observations that you are willing to share.
Data science for psychologists (ds4psy) by Hansjörg Neth is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The HTML-version of this book uses Google Analytics to evaluate the popularity of its different chapters. The website does not collect any personal data of individual users.
This book was generated using R version 4.2.1 (2022-06-23) and the following packages:
- bardr (0.0.9), base (4.2.1), BayesFactor (0.9.12.4.4), bookdown (0.28), circlize (0.4.15), coda (0.19.4), datasets (4.2.1), devtools (2.4.4), dplyr (1.0.10), ds4psy (0.8.0.9013), forcats (0.5.2), ggplot2 (3.3.6), graphics (4.2.1), grDevices (4.2.1), here (1.0.1), jpeg (0.1.9), knitr (1.40), lubridate (1.8.0), magrittr (2.0.3), Matrix (1.4.1), methods (4.2.1), purrr (0.3.4), RColorBrewer (1.1.3), readr (2.1.2), rmarkdown (2.16), stats (4.2.1), stringr (1.4.1), tibble (3.1.8), tidyr (1.2.0), tidyverse (1.3.2), unikn (0.5.0.9006), usethis (2.1.6), utils (4.2.1), viridis (0.6.2), viridisLite (0.4.1), yarrr (0.1.5).
Thanks to all package authors and the R community for making this book possible!
[85_coda.Rmd updated on 2022-09-19 17:55:16 by hn.]