5.11 Time: Means across time (or other categories)

5.11.1 Data & Packages & functions

  • Data: Various one-dimensional distributions (several single variables)
  • Plot type: Dot plot with error bars
  • geom_errorbar(): To create error bars
  • position=position_dodge(0.6): Dodge graph elements

5.11.2 Graph

  • We’ll reproduce and maybe criticize as well as improve Figure 5.19 (Bauer et al. 2020)
  • Questions:
    • What does the graph show? What are the underlying variables (and data)?
    • How many scales/mappings does it use? Could we reduce them?
    • What do you like, what do you dislike about the figure? What is good, what is bad?
    • What kind of information could we add to the graph (if any)?
    • How would you approach a replication of the graph?

Means across time/categories

Figure 5.19: Means across time/categories

5.11.3 Lab: Data & Code

  • The code for Figure 5.19 is shown below (and creates Figure 5.20).

  • Learning objectives

    • How to plot error bars
    • How to dodge graph elements

The data has already been pre-processed, i.e., we have a dataframe that contains both our means as well as 90% and 95% percent confidence intervals for different subsamples of the data (as well as the full sample). The subsample are constructed from information on whether certain respondents participated across all waves or not. The dataframe also provides information on how these means should be grouped.

## Parsed with column specification:
## cols(
##   wave = col_character(),
##   gdpr.know.num.mean = col_double(),
##   gdpr.know.num.sd = col_double(),
##   n = col_double(),
##   n_wo_NA = col_double(),
##   se = col_double(),
##   ci_95 = col_double(),
##   ci_90 = col_double(),
##   participation = col_character(),
##   label = col_character()
## )
Means across time/categories

Figure 5.20: Means across time/categories


Bauer, Paul C, Frederic Gerdon, Florian Keusch, and Frauke Kreuter. 2020. “The Impact of the GDPR Policy on Data Sharing/Privacy Attitudes.” Preliminary Draft, 1–22.