Visualizing Likert data I

Lecture 15

Dr. Greg Chism

University of Arizona
INFO 526 - Spring 2024

Warm up

Announcements

  • HW 4 is due April 3rd
    • All questions: Add alt text with fig-alt
  • RQ 4 is due March 22nd

Setup

# load packages
library(countdown)
library(tidyverse)
library(colorspace)
library(cowplot)
library(colorblindr)
library(waffle)

# set theme for ggplot2
ggplot2::theme_set(ggplot2::theme_minimal(base_size = 14))

# set width of code output
options(width = 65)

# set figure parameters for knitr
knitr::opts_chunk$set(
  fig.width = 7,        # 7" width
  fig.asp = 0.618,      # the golden ratio
  fig.retina = 3,       # dpi multiplier for displaying HTML output on retina
  fig.align = "center", # center align figures
  dpi = 300             # higher dpi, sharper image
)

Visualizing Likert data

Nature Graduate Student 2022 Survey

Data

nature <- read_csv(here::here("slides/15", "data/Nature_Graduate_Survey_2022.csv"))
glimpse(nature)
Rows: 3,253
Columns: 94
$ `To what extent do you agree with the following statements?: I am able to save money alongside my studies`                                                                            <chr> …
$ `To what extent do you agree with the following statements?: I am worried about the increasing cost of living`                                                                        <chr> …
$ `To what extent do you agree with the following statements?: Increased inflation will negatively impact my decision to further pursue my studies`                                     <chr> …
$ `To what extent do you agree with the following statements?: I regularly worry about my increasing student debt`                                                                      <chr> …
$ `What concerns have you had since you started your graduate degree? The difficulty of getting funding / low success rates for grant applications`                                     <chr> …
$ `What concerns have you had since you started your graduate degree? Inability to finish my studies in the time period I had set out to`                                               <chr> …
$ `What concerns have you had since you started your graduate degree? Impact of a poor relationship with my supervisor`                                                                 <chr> …
$ `What concerns have you had since you started your graduate degree? The number of available faculty research jobs`                                                                    <chr> …
$ `What concerns have you had since you started your graduate degree? The high numbers of early career researchers on continuing temporary contracts as postdocs`                       <chr> …
$ `What concerns have you had since you started your graduate degree? The difficulty of maintaining a work/life balance`                                                                <chr> …
$ `What concerns have you had since you started your graduate degree? Uncertainty about the value of a graduate degree`                                                                 <chr> …
$ `What concerns have you had since you started your graduate degree? Uncertainty about future employment/career prospects`                                                             <chr> …
$ `What concerns have you had since you started your graduate degree? Student debt during my graduate degree`                                                                           <chr> …
$ `What concerns have you had since you started your graduate degree? Financial worries after my graduate degree (cost of living, inability to save for a house, children, retirement)` <chr> …
$ `What concerns have you had since you started your graduate degree? Political landscape`                                                                                              <chr> …
$ `What concerns have you had since you started your graduate degree? Impostor syndrome`                                                                                                <chr> …
$ `What concerns have you had since you started your graduate degree? Concern about my mental health as a result of undertaking a graduate degree`                                      <chr> …
$ `What concerns have you had since you started your graduate degree? Poor support and acknowledgement of my parenting/elder care responsibilities`                                     <chr> …
$ `What concerns have you had since you started your graduate degree? Access to teaching staff and supervisors being restricted under remote study formats`                             <chr> …
$ `How satisfied are you with your decision to pursue a graduate degree?`                                                                                                               <chr> …
$ `Are you planning on pursuing a PhD once you’ve completed your Master's degree?`                                                                                                      <chr> …
$ `How satisfied are you with your graduate degree experience?`                                                                                                                         <chr> …
$ `Since the very start of your graduate school experience, would you say your level of satisfaction has:`                                                                              <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Availability of funding`                                                                      <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Hours worked`                                                                                 <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Social environment`                                                                           <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Degree of independence`                                                                       <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Recognition from supervisor`                                                                  <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Overall relationship with supervisor`                                                         <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Overall compensation and benefits`                                                            <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Vacation time`                                                                                <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Guidance received from adviser in lab/research`                                               <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Ability to attend meetings and conferences`                                                   <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Work-life balance`                                                                            <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Career pathway guidance and advice`                                                           <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Quality of teaching`                                                                          <chr> …
$ `How satisfied are you with each of the following attributes or aspects of your degree? Balance of teaching and practical elements`                                                   <chr> …
$ `My supervisor … Makes time for frank conversations about my career`                                                                                                                  <chr> …
$ `My supervisor … Is open to the idea of me pursuing a career outside academia`                                                                                                        <chr> …
$ `My supervisor … Has useful advice for careers outside academia`                                                                                                                      <chr> …
$ `My supervisor … Has encouraged me to attend career training and events`                                                                                                              <chr> …
$ `Mental health and wellbeing services in my university are tailored and appropriate to the needs of graduate students`                                                                <chr> …
$ `My supervisor has a good awareness of support services and was able to signpost me to them if needed`                                                                                <chr> …
$ `My university offers adequate one-to-one mental health support`                                                                                                                      <chr> …
$ `My university offers different types of support to promote mental health and wellbeing beyond one-to-one support (e.g. workshops, seminars, activities)`                             <chr> …
$ `My university supports good work-life balance`                                                                                                                                       <chr> …
$ `There is a long-hours culture at my university, including sometimes working through the night`                                                                                       <chr> …
$ `How much do you expect your graduate degree to improve your job prospects?`                                                                                                          <chr> …
$ Academia...49                                                                                                                                                                         <dbl> …
$ Academia...50                                                                                                                                                                         <dbl> …
$ Academia...51                                                                                                                                                                         <dbl> …
$ Academia...52                                                                                                                                                                         <dbl> …
$ Academia...53                                                                                                                                                                         <dbl> …
$ Industry...54                                                                                                                                                                         <dbl> …
$ Industry...55                                                                                                                                                                         <dbl> …
$ Industry...56                                                                                                                                                                         <dbl> …
$ Industry...57                                                                                                                                                                         <dbl> …
$ Industry...58                                                                                                                                                                         <dbl> …
$ Government...59                                                                                                                                                                       <dbl> …
$ Government...60                                                                                                                                                                       <dbl> …
$ Government...61                                                                                                                                                                       <dbl> …
$ Government...62                                                                                                                                                                       <dbl> …
$ Government...63                                                                                                                                                                       <dbl> …
$ `Non-profit...64`                                                                                                                                                                     <dbl> …
$ `Non-profit...65`                                                                                                                                                                     <dbl> …
$ `Non-profit...66`                                                                                                                                                                     <dbl> …
$ `Non-profit...67`                                                                                                                                                                     <dbl> …
$ `Non-profit...68`                                                                                                                                                                     <dbl> …
$ Medical...69                                                                                                                                                                          <dbl> …
$ Medical...70                                                                                                                                                                          <dbl> …
$ Medical...71                                                                                                                                                                          <dbl> …
$ Medical...72                                                                                                                                                                          <dbl> …
$ Medical...73                                                                                                                                                                          <dbl> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Collecting and analyzing data`                                                 <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Designing robust reproducible experiments`                                     <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Writing a paper for publication in a peer-reviewed journal`                    <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Applying for funding`                                                          <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Finding a satisfying career`                                                   <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Managing complex projects`                                                     <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Developing a business plan`                                                    <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Managing people`                                                               <chr> …
$ `How well is your current graduate degree preparing you to carry out each of the following activities? Managing a large operational budget`                                           <chr> …
$ `I feel that my graduate degree program is preparing me well for a research career`                                                                                                   <chr> …
$ `I feel that my graduate degree program is preparing me well for a non-research science-related career`                                                                               <chr> …
$ `Do you feel that you have experienced bullying during your graduate degree?`                                                                                                         <chr> …
$ `Do you feel able to speak out about your experiences of bullying without personal repercussions?`                                                                                    <chr> …
$ `Do you feel that you have experienced discrimination or harassment during your graduate degree?`                                                                                     <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....88`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....89`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....90`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....91`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....92`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....93`                                                                                                                      <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....94`                                                                                                                      <chr> …

Monetary concerns

To what extent do you agree or disagree with … Strongly Agree Somewhat Agree Neither Agree Nor Disagree Somewhat Disagree Strongly Disagree
I am able to save money alongside my studies 5 4 3 2 1
I am worried about the increasing cost of living 5 4 3 2 1
Increased inflation will negatively impact my decision to further pursue my studies 5 4 3 2 1
I regularly worry about my increasing student debt 5 4 3 2 1

Monetary concerns

nature |>
  select(contains("To what extent")) |>
  glimpse()
Rows: 3,253
Columns: 4
$ `To what extent do you agree with the following statements?: I am able to save money alongside my studies`                                        <chr> …
$ `To what extent do you agree with the following statements?: I am worried about the increasing cost of living`                                    <chr> …
$ `To what extent do you agree with the following statements?: Increased inflation will negatively impact my decision to further pursue my studies` <chr> …
$ `To what extent do you agree with the following statements?: I regularly worry about my increasing student debt`                                  <chr> …

Satisfaction

How satisfied are you with … Not Concerned at All Very Concerned
Your decision to pursue a graduate degree? 5 4 3 2 1
Your graduate degree experience? 5 4 3 2 1

Satisfaction

nature |>
  select(contains("How satisfied are you with your")) |>
  glimpse()
Rows: 3,253
Columns: 2
$ `How satisfied are you with your decision to pursue a graduate degree?` <chr> …
$ `How satisfied are you with your graduate degree experience?`           <chr> …

Bullying/Harassment

Do you feel that you have experienced bullying during your graduate degree? Yes No Prefer not to say
Do you feel able to speak out about your experiences of bullying without personal repercussions? Yes No Unsure
Do you feel that you have experienced discrimination or harassment during your graduate degree? Yes No Prefer not to say

Bullying/Harassment

nature |>
  select(contains("Do you feel")) |>
  glimpse()
Rows: 3,253
Columns: 3
$ `Do you feel that you have experienced bullying during your graduate degree?`                      <chr> …
$ `Do you feel able to speak out about your experiences of bullying without personal repercussions?` <chr> …
$ `Do you feel that you have experienced discrimination or harassment during your graduate degree?`  <chr> …

Bullying/Harassment II

Question Options Type of question Mandatory Y/N? Routing
Who was the perpetrator(s)

Please select all that apply.

a) Supervisor

b) Another student

c) Postdoc

d) Other academic staff member

e) Online troll

f) Other, please specify

Multiple choice

Same page as above

Prefer not to say exclusive

N Ask if Q31=yes (experienced bullying)

Bullying/Harassment II

nature |>
  select(contains("Who was the")) |>
  glimpse()
Rows: 3,253
Columns: 7
$ `Who was the perpetrator(s)? Please select all that apply....88` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....89` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....90` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....91` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....92` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....93` <chr> …
$ `Who was the perpetrator(s)? Please select all that apply....94` <chr> …

Demographics

Question Options Type of question Mandatory Y/N? Routing
Which, if any, of the following degrees are you currently studying for?

a) Master’s degree (MA/MS/MSc/PSM or other Master’s)

b) Doctorate degree (PhD/DPhil/MD)

c) Dual doctorate degree (MD-PhD, PhD-PhD or other combination)

Single choice Y

Ask to all

Screen out if not PhD or Masters’ student i.e. must select (a b or c)

Visualizing categorical data

Bullying/Harassment

If you were bullied, who was the perpetrator(s)?

nature_bullying <- nature |> 
  select(contains("Who was the")) |> 
  pivot_longer(cols = everything(), names_to = "Question", values_to = "person") 

nature_bullying |> distinct(person) |> drop_na() 
# A tibble: 7 × 1
  person                     
  <chr>                      
1 Supervisor                 
2 Another student            
3 Other                      
4 Postdoc                    
5 Other academic staff member
6 Prefer not to say          
7 Online troll               
nature_bullying <- nature_bullying |>
  mutate(
    person = fct_relevel(person, "Supervisor", "Postdoc", "Another student", "Other academic staff member", "Online troll", "Other", "Prefer not to say")
  )

Bar chart

nature_bullying |>
  filter(!is.na(person)) |>
  ggplot(aes(x = fct_rev(fct_infreq(person)))) +
  geom_bar() +
  coord_flip() +
  labs(x = NULL, y = "Count")

Pie chart

Waffle chart

Using waffle

Proportional waffle chart

Waffles work best when they are square – makes it easier to compare parts to whole which is the purpose of the chart

Proportional waffle chart, take 2

With a bit of fudging…

Let’s actually make these figures!

Code Demo.

Visualizing Likert data

Monetary concerns

nature |>
  select(contains("To what extent")) |>
  glimpse()
Rows: 3,253
Columns: 4
$ `To what extent do you agree with the following statements?: I am able to save money alongside my studies`                                        <chr> …
$ `To what extent do you agree with the following statements?: I am worried about the increasing cost of living`                                    <chr> …
$ `To what extent do you agree with the following statements?: Increased inflation will negatively impact my decision to further pursue my studies` <chr> …
$ `To what extent do you agree with the following statements?: I regularly worry about my increasing student debt`                                  <chr> …

Monetary concerns visualized

A very rough starting point:

Let’s improve!