Init
library(kirkegaard)
## Loading required package: tidyverse
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.6 ✓ dplyr 1.0.8
## ✓ tidyr 1.2.0 ✓ stringr 1.4.0
## ✓ readr 2.1.2 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
## Loading required package: weights
## Loading required package: Hmisc
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
## Loading required package: assertthat
##
## Attaching package: 'assertthat'
## The following object is masked from 'package:tibble':
##
## has_name
## Loading required package: magrittr
##
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
##
## set_names
## The following object is masked from 'package:tidyr':
##
## extract
## Loading required package: psych
##
## Attaching package: 'psych'
## The following object is masked from 'package:Hmisc':
##
## describe
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
## Loading required package: metafor
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
##
## Loading the 'metafor' package (version 3.0-2). For an
## introduction to the package please type: help(metafor)
## Loading required package: rlang
##
## Attaching package: 'rlang'
## The following object is masked from 'package:magrittr':
##
## set_names
## The following object is masked from 'package:assertthat':
##
## has_name
## The following objects are masked from 'package:purrr':
##
## %@%, as_function, flatten, flatten_chr, flatten_dbl, flatten_int,
## flatten_lgl, flatten_raw, invoke, splice
##
## Attaching package: 'kirkegaard'
## The following objects are masked from 'package:rlang':
##
## is_error, is_logical
## The following object is masked from 'package:psych':
##
## rescale
## The following object is masked from 'package:assertthat':
##
## are_equal
## The following objects are masked from 'package:purrr':
##
## is_logical, is_numeric
## The following object is masked from 'package:base':
##
## +
load_packages(
googlesheets4,
ggrepel
)
theme_set(theme_bw())
Calculations
#68th centile in IQ scale
qnorm(.68, 100, 15)
## [1] 107.0155
#0.78 standard deviations in IQ scale
15*.78
## [1] 11.7
#99th centile on IQ scale
qnorm(.99, 100, 15)
## [1] 134.8952
#99th centile on SAT scale, with SD 200
qnorm(.99, 1010, 200)
## [1] 1475.27
#99th centile on SAT scale, with SD 195
qnorm(.99, 1010, 200)
## [1] 1475.27
#99th centile to z score
qnorm(.99)
## [1] 2.326348
#99th centile to z score, to IQ z score
qnorm(.99) * 0.8
## [1] 1.861078
#99th centile to z score, to IQ score
(qnorm(.99) * 0.8) * 15 + 100
## [1] 127.9162
#perfect SAT 1600 to centile
pnorm(1600, 1010, 200)
## [1] 0.9984111
#perfect SAT 1600 to z score
pnorm(1600, 1010, 200) %>% qnorm()
## [1] 2.95
#perfect SAT 1600 to z score to IQ z score
(pnorm(1600, 1010, 200) %>% qnorm()) * .8
## [1] 2.36
#perfect SAT 1600 to z score to IQ scale score
((pnorm(1600, 1010, 200) %>% qnorm()) * .8)*15+100
## [1] 135.4
A look-up table
map_df(seq(200, 1600, 10), function(SAT) {
tibble(
SAT = SAT,
SAT_centile = pnorm(SAT, 1010, 200),
SAT_z = qnorm(SAT_centile),
IQ_z = SAT_z*0.8,
IQ = IQ_z*15+100
)
}) -> SAT_IQ_table
SAT_IQ_table
SAT to IQs by major
#read data
gs4_deauth()
sats = read_sheet(
"https://docs.google.com/spreadsheets/d/13gaFgtCMnvdgZdxaR3zwwpPf_WrGru_AxzTKnaMwRpY/edit?usp=sharing",
sheet = 2)
## ✓ Reading from "SAT to IQ table".
## ✓ Range ''SAT means by major''.
#add IQs
sats %<>% mutate(
SAT_centile = pnorm(`Mean total`, 1010, 200),
SAT_verbal_tilt = (`Mean verbal`-`Mean math`) %>% standardize(),
SAT_z = qnorm(SAT_centile),
IQ_z = SAT_z*0.8,
IQ = IQ_z*15+100
)
#plot it
sats %>%
ggplot(aes(IQ, SAT_verbal_tilt)) +
geom_point() +
geom_text_repel(aes(label = Major), size = 3, max.overlaps = 99) +
scale_x_continuous("Average IQ of probable undergraduates (from SAT)", breaks = seq(90, 130, 5), limits = c(95, 116)) +
scale_y_continuous("Verbal tilt (verbal - math score, in z scale)")

GG_save("figs/SAT_major_IQ_tilt.png")
#simpler plot
sats %>%
mutate(
Major = fct_reorder(Major, IQ),
) %>%
ggplot(aes(IQ, Major, color = SAT_verbal_tilt)) +
# geom_bar(stat = "identity")
geom_point() +
scale_x_continuous("Average IQ of probable undergraduates (from SAT)", breaks = seq(90, 130, 5), limits = c(95, 116)) +
scale_color_gradient2("Verbal tilt", mid = "grey")

GG_save("figs/SAT_major_IQ_tilt2.png")