This post includes R code and materials from my Computational Social Science course at Rutgers University. The course offers theoretical discussion and hands-on training using R. It is a doctoral seminar offering a gentle introduction to computational methods both for people with some previous experience in coding, and for those who are just starting to learn. The course covers a variety of topics including introduction to R, analyzing survey data, using APIs, web scraping, network analysis, natural language processing, machine learning, online experiments, and ethics.
You can download the 2023 course syllabus here.
Below is the R code accompanying my 2023 course lectures. You can also find the materials in my CSS GitHub repository.
- Introduction to R (data formats, flow control, packages)
- Analyzing survey data (descriptives, recoding, GLM, weights)
- Working with APIs (Twitter, Reddit, Internet Archive, bibliometrics)
- Web scraping (rvest, xpath, pattern matching)
- Network analysis 1 (network data, network descriptives)
- Network analysis 2 (reciprocity, transitivity, homophily)
- Network analysis 3 (communities, permutation tests, QAP & netlm)
- Network analysis 4 (exponential random graph models)
- Data visualization (introduction to ggplot2)
- Text analysis 1 (preprocessing, term frequencies, sentiment)
- Text analysis 2 (n-grams, topic models)
- Machine learning (tidymodels, classification, regression)
Some of the recommended books for the course include:
- Salganik, M. J. (2017). Bit by Bit: Social Research in the Digital Age.
Available to read online or purchase on Amazon. - Wickham, H., & Grolemund, G. (2017). R for Data Science.
Available to read online or purchase on Amazon. - Long, J. D., & Teetor, P. (2019). R Cookbook, 2nd Edition
Available to read online or purchase on Amazon. - Silge, J., & Robinson, D. (2017). Text Mining with R.
Available to read online or purchase on Amazon.