This chapter focuses on transforming survey data from the 2012 General Social Survey (GSS) and visualizing it using the R programming language. The survey targets the American population's attitudes t...This chapter focuses on transforming survey data from the 2012 General Social Survey (GSS) and visualizing it using the R programming language. The survey targets the American population's attitudes towards police use of force. The chapter explains how to import the data using the haven package, transform categorical variables correctly, and employ the dplyr package for data manipulation. Additionally, it introduces the ggplot2 package for creating graphical representations of the data.
This chapter focuses on creating new variables and producing summary statistics using the 2018 Part 1 crime data from Pennsylvania's Uniform Crime Report. It explains the distinction between Part 1 (s...This chapter focuses on creating new variables and producing summary statistics using the 2018 Part 1 crime data from Pennsylvania's Uniform Crime Report. It explains the distinction between Part 1 (serious) and Part 2 (less serious) crimes and the limitations of the UCR due to underreporting. The chapter guides how to manipulate data in R, including renaming variables, calculating crime rates, and categorizing cities by population.