Editing Statistics and Statistical Programming (Fall 2020)/pset3
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 42: | Line 42: | ||
* total number of searches that month/year | * total number of searches that month/year | ||
* proportion of total searches (within the <code>subject_race</code> group identified for the row). | * proportion of total searches (within the <code>subject_race</code> group identified for the row). | ||
''Note that this will result in a data frame with multiple rows per month/year (as many as one row for each <code>subject_race</code> category) | (''Note that this will result in a data frame with multiple rows per month/year (as many as one row for each <code>subject_race</code> category)''). | ||
2. Use <code>ggplot2</code> and the [https://ggplot2.tidyverse.org/reference/geom_path.html <code>geom_line</code>] layer to generate each of the plots. Note that you'll want to assign <code>subject_race</code> as an aesthetic element ( | 2. Use <code>ggplot2</code> and the [https://ggplot2.tidyverse.org/reference/geom_path.html <code>geom_line</code>] layer to generate each of the plots. Note that you'll want to assign <code>subject_race</code> as an aesthetic element (`aes`) for some of the plots so that ggplot2 represents each category as a separate line (maybe distinguished by color?). Make sure to incorporate useful titles, axis labels, and legends for each plot you produce. Recall that the R tutorials include examples of using <code>aes</code> with <code>ggplot2</code>. | ||
=== PC6. Calculate baseline population proportions for relevant race/ethnicity categories === | === PC6. Calculate baseline population proportions for relevant race/ethnicity categories === | ||
Line 50: | Line 50: | ||
To help interpret the results of the foregoing analysis of the traffic stop data, we should calculate some baseline population proportions of the same race/ethnicity categories in the state of Illinois around the same time that the SOPP data comes from. Luckily, we have access to exactly the data we need to do this via our old friend, the <code>openintro</code> library! | To help interpret the results of the foregoing analysis of the traffic stop data, we should calculate some baseline population proportions of the same race/ethnicity categories in the state of Illinois around the same time that the SOPP data comes from. Luckily, we have access to exactly the data we need to do this via our old friend, the <code>openintro</code> library! | ||
Use the <code>county_complete</code> dataset from the <code>openintro</code> library to calculate the proportions of the Illinois population in 2010 in each of the categories identified in the <code>subject_race</code> variable of the traffic stop dataset | Use the <code>county_complete</code> dataset from the <code>openintro</code> library to calculate the proportions of the Illinois population in 2010 in each of the categories identified in the <code>subject_race</code> variable of the traffic stop dataset. Be sure to note and justify any assumptions and/or recoding decisions that you make along the way. | ||
== Statistical Questions == | == Statistical Questions == |