diff --git a/source/legislation/sec_leg-visualize.ptx b/source/legislation/sec_leg-visualize.ptx index 85ae7400..0326a9b5 100644 --- a/source/legislation/sec_leg-visualize.ptx +++ b/source/legislation/sec_leg-visualize.ptx @@ -1,543 +1,51 @@ -
- Visualizing the Data - - - Introduction to the data set and how to work with variables - - Motivating Ideas -

In this section I will...

-
    -
  • Make inferences about trends based on data and graphs.
  • -
  • Summarize the relationships between variables.
  • -
  • Interpret visualizations (i.e. bar charts) based on legislative data.
  • -
-
-

A common claim in the news media, and a common feeling among transgender and nonbinary folks, is that 2023 is by far the worst recent year for anti-trans legislation. How do we explore if 2023 was the year of anti-trans legislation? This question is vague - what does an answer to this question mean? How do we use this information in our advocacy? In order to conduct research, we need to drill down into more specific questions that can be answered empirically. This is an important story that needs to be documented to mitigate and eventually prevent future cases of hate. We are trying to understand broader patterns to better understand where our advocacy work may make a difference. -

- -

The targeting of the transgender community through legislation has been a significant topic in the news in 2023. We could compare the volume of news stories related to anti-trans legislation in 2023 to the volume in previous years. However, does this approach measure what we are looking for? Perhaps the same story is being repeated multiple times?

- -

A better approach is to look at the legislation itself. We can ask a similar question about the legislation. What - if anything - was different about the volume of anti-trans legislation in 2023 from the volume in previous years? This is another question we can investigate with data in order to tell this story.

- - -

Let's take a look at the data we sourced and cleaned in the last section. Note, we include the cleaned version of the data in this section, so if you missed the prior section, or did not finish you can still explore in this section.

- -

Note that crossing over refers to a bill being passed out of one state legislative chamber (either the State House or State Senate) and moving forward for consideration in the other chamber. Thus, a bill that has crossed over suggests majority support for the bill in at least one chamber. -

- - -

- Where did the data come from? Assess the trustworthiness of the data and the sources. -

-
- - A variable is, roughly, a column in the dataset. - -

We described some of the variables that are in this dataset. -

    -
  1. What variables would you be interested in that are missing from the data?
  2. -
  3. What questions do you have about the data set?
  4. -
-

- - - A quantitative variable is a variable that represents something that is inherently numerical (such as the cost of a good or service), and a categorical variable is a variable whose values represent certain categories (such as military ranks). - - -

- Which variables in the dataset are quantitative and which are categorical? -

- -

Sometimes variable values are directly observable. For example, if we wanted to make a dataset for the price of a specific product at three different stores, we can go to the stores and find those prices. Sometimes variable values are not directly observable. For example, the number of individuals in a location who have committed crimes.

- - A proxy variable is a directly observable variable that is used in place of variable that is not directly observable. For example, we may use the number of convicted criminals as a proxy for the number of criminals. - - -

What research questions do you have after exploring the data set?

-
- - -
- - -How to explore the data visually - -

-We often start investigating our questions by exploring and becoming familiar with our data. One of the most powerful -ways to explore data (as well as to communicate with data) is through visualization through graphs and charts. -

- -

- Before proceeding, be sure to run this code cell that reads in the data file. -

- - - - sink('/dev/null'); library(tidyverse) - #Load the data file - anti_trans_bills_clean <- read.csv("https://github.com/Zibiana/QR4SJ/raw/main/assets/data-leg/anti-trans-bills-clean.csv"); sink(); closeAllConnections() - - #Take a peek at the data file - head(anti_trans_bills_clean,15) - - - - - - -

-

    -
  1. What are some types of graphs you have seen before? For each, what do you think that type of graph is useful for?
  2. -
  3. The data set includes the status of each bill. Review the dataset. What are the different statuses?
  4. -
  5. Let's generate a graph showing how many bills there are with each status. - To generate a graph, replace the [INSERT_GRAPH_TYPE] with one of the following in the code cell below:

    -
      -
    1. -

      - A bar graph: geom_bar(stat = "identity") -

      -
    2. -
    3. -

      - A histogram: geom_histogram(binwidth = 1) -

      -
    4. -
    5. -

      - A boxplot: geom_boxplot() -

      -
    6. -
    7. -

      - A line graph: geom_line() -

      -
    8. -
    9. -

      - A pie graph: This is the Nickelback of charts (see https://www.businessinsider.com/pie-charts-are-the-worst-2013-6) -

      -
    10. -
    11. -

      - A scatterplot: geom_point() -

      -
    12. -
    - - - graph_type = INSERT_GRAPH_TYPE - anti_trans_bills_type <- anti_trans_bills_clean %>% group_by(`Bill.Type`) %>% summarise(n = n()) - graph_1 <- anti_trans_bills_type %>% ggplot(aes(x = `Bill.Type`, y = n)) + graph_type + coord_flip() - - -

    - Try to create each type of graph in R. Some will cause errors - that is a sign that this type of graph isn’t appropriate for this question. - Which graph do you think is the clearest? Why do you think that is? - What do you notice from this graph? Does this tell you anything about our question regarding 2023? -

    -
  6. -
  7. -

    Now let us look at what is happening by year. Run the following code cell to group the data by year. -

    - - - sink('/dev/null') - #Group by year - anti_trans_bills_by_year <- anti_trans_bills_clean %>% group_by(year) %>% summarise(n = n()) - # Remove NA values - anti_trans_bills_by_year <- na.omit(anti_trans_bills_by_year) - # Remove a couple outlier values - anti_trans_bills_by_year <- anti_trans_bills_by_year %>% filter(year != 1905) #Need to omit this observation - anti_trans_bills_by_year <- anti_trans_bills_by_year %>% filter(year != 2017) #There is only one bill here, and it is causing distortion in the graphs - - #filter by year and status - anti_trans_bills_by_year_enacted <- anti_trans_bills_clean %>% filter(Status == "Signed/Enacted") %>% group_by(year) %>% summarise(n = n()) - - # Remove NA values - anti_trans_bills_by_year_enacted <- na.omit(anti_trans_bills_by_year_enacted) - #Remove a couple outlier values - anti_trans_bills_by_year_enacted <- anti_trans_bills_by_year_enacted %>% filter(year != 1905) #Need to omit this observation - anti_trans_bills_by_year_enacted <- anti_trans_bills_by_year_enacted %>% filter(year != 2017) #There is only one bill here, and it is causing distortion in the graphs - sink(); closeAllConnections() - - -

    For the following two pieces of data, generate each type of graph and answer the same questions from above: Which graph do you think is the clearest? Why do you think that is? - What do you notice from this graph? Does this tell you anything about our question regarding 2023? -

    -
      -
    1. -

      - The total number of bills proposed between 2018 and 2023. -

      - - - total_bills_by_year <- anti_trans_bills_by_year %>% ggplot(aes(x = year, y = n)) + geom_line() - - - -
    2. -
    3. -

      - The bills signed and enacted between 2018 and 2023. -

      - - - total_bills_by_year_enacted <- anti_trans_bills_by_year_enacted %>% ggplot(aes(x = year, y = n)) + geom_line() - - -
    4. -
    -
  8. -
-

-
- - - - -

Let us look back at our work and see if we can draw some conclusions, both about data visualization and about our story regarding anti-trans legislation in 2023. -

    -
  1. - For each graph you generated, what were the variables involved? Were they quantitative or categorical? Which graphs contribute toward our understanding of our question? -
  2. -
  3. - Which types of graphs did you choose? Compare your choices to the variables you compared. What do you notice? Write a guideline to help select one or more graph types based on the data you are examining. -
  4. -
  5. -Based on what you found, write one or two sentences summarizing our findings so far regarding anti-trans legislation in 2023. -
  6. -
-

-
- -

There is a difference between a count and a proportion. A count value tells you the raw number of times something occurs, whereas a proportion tells you the percentage of the total times something occurs. Whenever dealing with proportions, you have to think carefully about the denominator! -

-
- - Two or more variable graphing - -

-Both quantitative and qualitative data can be analyzed under two types, categorical and numerical. Categorical data allows us to organize the data into sections or groupings that have similar characteristics. Numerical data often allows us to draw comparisons between the data and analyze trends, relationships, outliers, and other statistical qualifiers. Within the classification of numerical data, we have more descriptive graphs that can be used (scatter plot, line graph, bar graph, etc.) -

- - -Activity Questions: -

- Often we want to compare one variable against another to see how they might be associated. So it's worthwhile to imagine how we'd plot two variables on a single graph. Let's explore some of those graph types here. - -

- -
    -
  1. -

    - A scatterplot: geom_point() -

    -
  2. -
  3. -

    - A stacked bar graph: CODEGOESHERE -

    -
  4. -
  5. -

    - A stacked bar graph with proportions: CODEGOESHERE -

    -
  6. -
  7. -

    - A dodge bar graph: CODEGOESHERE -

    -
  8. -
  9. -

    - A dodge bar graph with proportios: CODEGOESHERE -

    -
  10. - -
  11. -

    - A boxplot: CODEGOESHERE -

    -
  12. -
- - - #CODE NEEDS TO BE UPDATED - graph_type = INSERT_GRAPH_TYPE - anti_trans_bills_type <- anti_trans_bills_clean %>% group_by(`Bill.Type`) %>% summarise(n = n()) - graph_1 <- anti_trans_bills_type %>% ggplot(aes(x = `Bill.Type`, y = n)) + graph_type + coord_flip() - - - -

- Try to create each type of graph in R. Some will cause errors - that is a sign that this type of graph isn’t appropriate for this question. - Which graph do you think is the clearest? Why do you think that is? - What do you notice from this graph? Does this tell you anything about our question regarding 2023? Do these graphs prompt any new questions? -

- -
- -

-In the above activity we had bar graphs that allows us to compare the numerical data of a particular variable (total number of passed bills from 2018 to 2023) with the total number of introduced bills within this same time period or the total number of bills that crossed over again during the same time period. Using these graphs we can explore a relationship between the proportions of bills which are crossed over or passed within each year as well as the trend over time as to what proportions are crossed over or passed. These bar graphs are sometimes referred to as multigraphs. -

- - - - -

- In the above activity we created similar graphs by focusing on the frequency or count of a Bill.Type appearing, and then we'd look at the proportion of that Bill.Type compared to the total number of bills during that year. Let's explore the pros and cons of representing data in these two methods. -

- -

- Try to create each type of graph in R. Some will cause errors - that is a sign that this type of graph isn’t appropriate for this question. - Which graph do you think is the clearest? Why do you think that is? - What do you notice from this graph? Does this tell you anything about our question regarding 2023? -

- -

-

    -
  1. Can you see how this data can also be described by using a line graph? Are there any advantages or disadvantages of using one over the other?
  2. - - - - - #CODE NEEDS TO BE UPDATED to have the two graph types!!! somethingvsomething? - graph_type = INSERT_GRAPH_TYPE - anti_trans_bills_type <- anti_trans_bills_clean %>% group_by(`Bill.Type`) %>% summarise(n = n()) - graph_1 <- anti_trans_bills_type %>% ggplot(aes(x = `Bill.Type`, y = n)) + graph_type + coord_flip() - - - -

    CODEGOESHERE for proportion vs. count graph for types of anti-trans bills proposed in 2023 compared to previous years to showcase if absolute or relative frequency is best to be used in this way. Want 4 graphs, 2 graphs are rate vs count of types of bills. The second two graphs are rate vs count of passed bills. -

    - -
  3. What story is each of these graphs telling? How do they differ? How are they similar.
  4. - -
-

-
- - -

- In the code below, you can change the variables by replacing "INSERT_Variable" with your variable that you want to explore. -

- - - #CODE NEEDS TO BE UPDATED - variable_1 = anti_trans_bills_clean$INSERT_1ST_Variable - variable_2 = anti_trans_bills_clean$INSERT_2ND_Variable - - ggplot(anti_trans_bills_clean, aes(x = factor(`variable_1`), fill = factor(`variable_2`))) + geom_bar(position = "dodge") - - -

- - - -

    -
  • Consider the total number of bills passed from 2018 to 2022 and the total number of bills passed in 2023.
  • - -
      -
    • First, create a multigraph which categorizes the Bill.Type on the x-axis and lists the totals by Status.
    • -
    • Then create another multigraph which categorizes Status on the x-axis and lists the totals by Bill.Type.
    • -
    -
  • Which of these two graphs tells a more compelling story?
  • -
  • List your thoughts on how the same data presented in two different ways can seem to show different results.
  • -
- -

- -
- -
- -
- - How do we tell a story with the data: answering how is 2023 different from other years - -

We began this chapter with the question of how 2023 is different from other years in regards to anti-trans legislation. Section 2 introduced us to different visualizations that can help us explore this and evaluate this question. -

- - - -

-Figure NUM is a line graph that plots raw numbers of bills introduced in each year from 2018-2023. We can see that the number of bills is increasing each year, but the numbers increased more quickly in 2021 and 2023 than in other years. -

- - -

-What feature of the line graph demonstrates this increase? -

- - - -

-We might want to know what prompted these increases to happen, and knowing which types of bills were being proposed during those years might provide insight. Below is a line graph showing just one type of bill. By changing VARIABLE to other types (list), you can generate different graphs. -

- -

- - -#Line graph of one *type* of bill over time - - -

- -

-

    -
  1. -Which types of bills are increasing in prevalence? Which are decreasing? -
  2. -
  3. What type(s) of bills drove the large increase in 2021? What types of bills drove the large increase in 2023?
  4. -
-

- -

Our analysis has so far been focused on bills that were introduced. -

    -
  1. What do we learn from analyzing bills that have been introduced?
  2. -
  3. What do we learn from analyzing bills that have been passed?
  4. -
  5. Do we need to analyze both–do these different questions tell us different things?
  6. -

-
- - - - -Tell students how to re-run previous analyses for *passed* bills rather than *introduced* bills. - - -

-Our previous visualizations showed that 2023 did have a significant increase in the number of anti-trans bills that were both introduced and passed. In addition to the absolute frequency counts of bills that have passed, we might also be interested in the relative proportion of bills that have been passed–that is, are legislators who are targeting transgender people becoming more successful in their efforts? -

- -

-SOME KIND OF VISUALIZATION OF "SUCCESS" RATE OVER TIME GOES HERE -

- -

SUMMARIZE THE STORY HERE -

- -

    -
  1. - What total number of anti-trans bills were proposed each year from 2018 to 2023? +
    + Visualizing the Data + + Motivating Ideas +

    In this section I will...

    +
      +
    • Learners will investigate the supposed neutrality of Data.
    • +
    • Learners will be able to formulate questions based on available data and extract the data needed to make informed and justified claims.
    • +
    • Learners will be able to storytell through visualization and be able to evaluate what an author is trying to say when they choose a visualization.
    • +
    +

    + There has been a dramatic rise in anti transgender legislation being proposed and being passed across the US. These bills have very real and horrible effects on people’s lives. How do we conceptualize how overwhelming these numbers are? How do we make sure that we are still humanizing the data as we work with it? Youtuber Lindsay Ellis refers to this as the vulgarity of numbers in her video essay "The unforgivable sin of Ms. Rachel". One tool we can learn in this chapter is to explore the numbers from different numerical lenses. We can also explore how people gather and talk about data on transgender individuals.

    +
    + + + Looking at Data about Anti-transgender legislation (making sense of the numbers we see) +

    + There are many ways people choose to represent data. We use visuals to quickly communicate ideas to others. From bargraphs and tables, scatterplots, maps, to infographics and more we can tell a story about a population or problem. +

    + +

    In this activity, we will consider data on bills that impact transgender and gender-diverse people across the United States from Trans Legislation Tracker. Trans Legislation Tracker is an independent research organization tracking bills that impact trans and gender-diverse people across the United States. The link we are using goes to 2025 data.

    +

    Begin by going to the Trans Legislation Tracker above.

    +
      +
    1. What is the first thing you notice?
    2. +
    3. Scroll down to the graph displaying the number of anti-transgender bills that were considered versus the number that were passed. What are your initial thoughts on the way this data is presented?
    4. +
    5. Now, scroll down to the section that displays the types of bills that are being proposed. What different pieces of information are you able to gather from this section? Try to name at least two.
    6. +
    7. For the map-based visualization of anti-transgender bills, select one or more states. What do you notice across the different states you selected? Feel free to comment on the data and information itself or also on the way it is displayed.
    8. +
    9. Navigate to the “Previous Years” tab on the navigation bar. Select a past year and compare your findings.
    10. + +
    +
    +
    + + Reading the Story from Data +

    Many places document data about anti-transgender legislation that are introduced, however the questions they ask differ. In this section, we will explore what stories are highlighted through different datasets.

    + +

    In this activity we'll use data sets created by the ACLU to help us see what questions we wondered in the preactivity we can answer as well as become comfortable with exploring data sets using spreadsheets. The ACLU (American Civil Liberties Union) has tracked anti-LGBTQ bills in the U.S. State Legislature in years 2023, 2024, and 2025.

    +
      +
    1. What does this data tell us?
    2. +
      1. +
      2. Download the CSVs of this data (there is a link to do so at the bottom of the table).
      3. +
      4. Review the dataset. What do you notice? What is interesting about this data?
      5. +
      6. Choose a state. How many bills were defeated in that state? How many bills were passed into law? Are there issues that are more likely to be defeated? Are there issues that are more likely to be passed into law?
      7. +
      8. Compare what your group discovered to what other groups discovered about their states. What do you wonder?
      9. +
      10. Use the data to try to explore your questions that you wondered in the preactivity or what you are wondering now.
      11. +
    3. - -
    4. What total number of anti-trans bills were passed each of these years? -
    5. - -
    6. - What types of anti-trans bills were proposed more often in 2023 than in previous years? -
    7. - -
    8. - What types of anti-trans bills were passed more often in 2023? -
    9. - - - -

    - - -

      - -
    1. The data in 2023 stops in April 2023, does this impact our ability to answer any of these questions? How does it impact our ability to answer our questions?
    2. -
    3. In 2023, since the session is not over in many states, we run the analysis in two ways: including both bills that crossed over and bills that were signed/enacted, and only considering bills which were signed/enacted. What are the pros and cons of each of these decisions in studying the data?
    4. -
    5. What observations did you make about how many anti-trans bills pass than all previous years since 2018 combined (again, recall that the 2023 data in this analysis only goes through April 21, 2023).
    6. -

    - -
    - - - -

    -Given our questions this means the variables and levels were are interested in are the bills passed, crossed over (hence passed by at least one chamber of the legislature and not yet dead), and/or signed and enacted between 2021 and 2023, as well as in each year and in the years preceding 2023. -

    - -

    -As you explored in the activity part 1, these bills only go through April 21, 2023. To emphasize the change in the number of bills that have a chance of passing or have already been passed over time, we combine all the years 2017-2022 and compare them to 2023. -

    - - -

    Our first visualizations give information about the count of these bills, but let us talk about the likelihood of any particular anti-trans bill to pass in 2023 compared to previous years. We saw in graph blah that there appears to be a slight increase in the proportion of bills of all types that passed in 2023 compared to 2018-22. -

    - -

    -This final image doesn't demonstrate an obvious finding, but does motivate another question. Is the difference we are seeing between the two groups significant? What can we infer if we had more refined tools like statistical tests (chi squared, ANOVA, prop test, etc). Or we can refine our questions further, for example, what changes in voter districts, voter laws, or state congress and senate makeup has changed from 2022 to 2023? -

    - - -

    - stuffstuff -

    -
    - - - - - - -

    -Tell a story about the data -What information contributes to answering our research question? -What information does not? -What limitations are there when working with this data? -

    - - - - - -

    In section 1, you wrote ideas about research questions you wanted to explore given this data set. Using the tools we have learned in this section, which questions do you think could be explored and potentially answered? Why you think so? Which graphs would you utilize to explore the data?

    -
    - - - - - - - - - - -
    - - - - Exercises - - -

    In Section 2, you learned how to read visualizations and how to modify code to create them. Using a question from exercise 1, create graphs that you feel would best help you answer your question. Explain what each graph represents, and what you are noticing in those graphs.

    - -
    - - - -

    In Section 3, we learned how to synthesize exploratory data visualizations and tell a story with our data. Based on the graphs you created in the prior exercise, tell a story with your data. What actions do you want your data to lead to and how are you using the data to tell that story?

    - -
    - - -

    Now, let's put everything together and refer to the following figure and answer the following questions.

    -

    -
      -
    • What is the name of this type of visualization?
    • -
    • In the year 2023, what bill type is most common?
    • -
    • During which year were the most Youth Athletics bills passed?
    • -
    • About how many bills were passed in the year 2021?
    • -
    • What is an alternative way to visualize this set of data?
    • -
    • If you grouped by “Bill Type,” how many tick marks would be on the x-axis?
    • -
    -

    For more information on creating grouped and stacked bar plots in R, check out the tutorials in R Graph Gallery.

    - -
    - -
    - - - -
    - +
+ +
+
\ No newline at end of file