Children’s Games
Setting up R Packages
Plot Theme
Show the Code
# https://stackoverflow.com/questions/74491138/ggplot-custom-fonts-not-working-in-quarto
# Chunk options
knitr::opts_chunk$set(
fig.width = 7,
fig.asp = 0.618, # Golden Ratio
# out.width = "80%",
fig.align = "center"
)
### Ggplot Theme
### https://rpubs.com/mclaire19/ggplot2-custom-themes
theme_custom <- function() {
font <- "Roboto Condensed" # assign font family up front
theme_classic(base_size = 14) %+replace% # replace elements we want to change
theme(
panel.grid.minor = element_blank(), # strip minor gridlines
text = element_text(family = font),
# text elements
plot.title = element_text( # title
family = font, # set font family
size = 16, # set font size
face = "bold", # bold typeface
hjust = 0, # left align
# vjust = 2 #raise slightly
margin = margin(0, 0, 10, 0)
),
plot.subtitle = element_text( # subtitle
family = font, # font family
size = 14, # font size
hjust = 0,
margin = margin(2, 0, 5, 0)
),
plot.caption = element_text( # caption
family = font, # font family
size = 8, # font size
hjust = 1
), # right align
axis.title = element_text( # axis titles
family = font, # font family
size = 10 # font size
),
axis.text = element_text( # axis text
family = font, # axis family
size = 8
) # font size
)
}
# Set graph theme
theme_set(new = theme_custom())
#
Introduction
Children in the ages of 6 to 7 years are asked if they want to play two games. This dataset pertains to their responses about the two games. The research is based on this paper:
Lin Bian et al. ,Gender stereotypes about intellectual ability emerge early and influence children’s interests. Science 355,389-391(2017).DOI:10.1126/science.aah6524. This very short and crisp paper is available here.
Read the Data
The data is part of the R package openintro
. Yes, install it. From the help menu ?children_gender_stereo
:
This data object is more unusual than most. It is a list of 4 data frames. The four data frames correspond to the data used in Studies 1-4 of the referenced paper, and these data frames each have variables (columns) that are explained below:
List of 4
$ 1:'data.frame': 192 obs. of 5 variables:
..$ subject : int [1:192] 1 2 3 4 5 6 7 8 9 10 ...
..$ gender : chr [1:192] "female" "female" "female" "male" ...
..$ age : int [1:192] 7 7 7 6 7 5 5 5 5 5 ...
..$ trait : chr [1:192] "smart" "smart" "smart" "smart" ...
..$ stereotype: num [1:192] 0.611 0.278 0.722 0.556 1 ...
$ 2:'data.frame': 576 obs. of 7 variables:
..$ subject : int [1:576] 1 2 3 4 5 6 7 8 9 10 ...
..$ gender : chr [1:576] "male" "male" "male" "female" ...
..$ age : int [1:576] 6 5 7 5 5 7 6 6 5 5 ...
..$ trait : chr [1:576] "smart" "smart" "smart" "smart" ...
..$ target : chr [1:576] "adults" "adults" "adults" "adults" ...
..$ stereotype : num [1:576] 0.75 1 0.25 1 0.25 0.75 0 0.5 0.75 1 ...
..$ high_achieve_caution: num [1:576] 0.25 1 0.25 1 0.75 0.5 0.5 0.75 0.5 0.5 ...
$ 3:'data.frame': 128 obs. of 7 variables:
..$ subject : int [1:128] 1 2 3 4 5 6 7 8 9 10 ...
..$ gender : chr [1:128] "female" "male" "female" "male" ...
..$ age : int [1:128] 7 7 7 7 7 6 7 7 6 6 ...
..$ game : chr [1:128] "smart" "smart" "smart" "smart" ...
..$ interest : num [1:128] 0.328 0.781 0.781 -0.213 -2.304 ...
..$ difference: num [1:128] 0.244 0.453 0.209 -0.577 -1.523 ...
..$ stereotype: num [1:128] -1.7982 0.0866 -1.7982 0.7784 -0.6051 ...
$ 4:'data.frame': 96 obs. of 4 variables:
..$ subject : int [1:96] 1 2 3 4 5 6 7 8 9 10 ...
..$ gender : chr [1:96] "female" "female" "female" "female" ...
..$ age : int [1:96] 6 6 6 6 6 6 6 6 6 6 ...
..$ interest: num [1:96] 0.3924 0.68 -0.7163 -0.4279 -0.0413 ...
Let us choose, arbitrarily, the third study:
## Choosing, arbitrarily, the third game/third study
children_gender_stereo[[3]] -> games3
glimpse(games3)
Rows: 128
Columns: 7
$ subject <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, …
$ gender <chr> "female", "male", "female", "male", "female", "female", "ma…
$ age <int> 7, 7, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6,…
$ game <chr> "smart", "smart", "smart", "smart", "smart", "smart", "smar…
$ interest <dbl> 0.328241235, 0.781351865, 0.781351865, -0.213178560, -2.303…
$ difference <dbl> 0.24441071, 0.45311063, 0.20869992, -0.57713058, -1.5226918…
$ stereotype <dbl> -1.79820307, 0.08662039, -1.79820307, 0.77835148, -0.605110…
Data Dictionary
Write in.
Write in.
Write in.
Analyse/Transform the Data
```{r}
#| label: data-preprocessing
#
# Write in your code here
# to prepare this data as shown below
# to generate the plot that follows
# Counts, histograms etc
```
Research Question
Is there a difference the average interest level between Boys and Girls for the two kinds of games, “Smart Game” and “Try Hard Game”? Does that lead to the inference of how children acquire gender stereotypes about play?
Plot the Data
Task and Discussion
Complete the Data Dictionary. Select and Transform the variables as shown. Create the graphs shown below and discuss the following questions:
- Identify the type of charts
- Identify the variables used for various geometrical aspects (x, y, fill…). Name the variables appropriately.
- What research activity might have been carried out to obtain the data graphed here? Provide some details.
- Does the Chart answer the Hypothesis? Justify?
- Write a 2-line story based on the chart, describing your inference/surprise.