Code
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(dplyr))
This page generates data visualizations related to the Elkind (1961) study. In the original paper, the data were presented in tabular form.
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(dplyr))
<- c(5, 6, 7, 8, 9, 10, 11)
age_yrs <- c("mass", "weight", "volume")
quantity_type <- rep(age_yrs, length(quantity_type))
age <- rep(quantity_type, each = length(age_yrs))
conservation_type
<- c(19, 51, 70, 72, 86, 94, 92,
pct 21, 52, 51, 44, 73, 89, 78,
0, 4, 0, 4, 4, 19, 25)
<- data.frame(age = age, type = conservation_type, pct = pct) conservation
|>
conservation ggplot() +
geom_point(aes(x = age, y = pct, color = type)) +
geom_line(aes(x = age, y = pct, color = type, group = type)) +
guides(color = guide_legend("Judgment type")) +
ylim(0, 100)
<- c(5, 6, 7, 8, 9, 10, 11)
age_yrs <- c("romancing", "perceptual", "specific", "general")
explanation_type <- rep(age_yrs, length(explanation_type))
age <- rep(explanation_type, each = length(age_yrs))
explanation
<- c(4, 3, 7, 7, 0, 1, 1,
pct 85, 64, 53, 57, 36, 31, 33,
11, 33, 40, 36, 60, 51, 49,
0, 0, 0, 0, 4, 16, 18)
<- data.frame(age = age, type = explanation, pct = pct) explanations
|>
explanations ggplot() +
geom_point(aes(x = age, y = pct, color = type)) +
geom_line(aes(x = age, y = pct, color = type, group = type)) +
guides(color = guide_legend("Explanation type")) +
ylim(0, 100)