Skip to content

Instantly share code, notes, and snippets.

@tradingbills
Created August 2, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tradingbills/5f7db5f3534193b97bf65099b67470b7 to your computer and use it in GitHub Desktop.
Save tradingbills/5f7db5f3534193b97bf65099b67470b7 to your computer and use it in GitHub Desktop.
z_score <- function(x, m, sd){
return ((x-m)/sd)
}
x_val <- function(z, m, sd){
return (z*sd + m)
}
m <- 100
sd <- 15
z_score(130, m, sd)
pnorm(2)
a <- 1 - pnorm(2)
b <- 1 - pnorm(-2)
b - a
1-.9772499
# https://www.youtube.com/watch?v=mai23vW8uFM
# How many people have an IQ above an IQ of 130, where the mean is 100 and the sd is 15
m <- 100
sd <- 15
1 - pnorm(z_score(130, m, sd))
# How many people have an IQ above an IQ of 145, where the mean is 100 and the sd is 15
1 - pnorm(z_score(145, m, sd))
# https://www.youtube.com/watch?v=CjF_yQ2N638&list=PLiIsR5PZj8mvM09Zl5X8CqK8uhUdo1cow&index=2&t=287s 7:46
x_val(1.4, 50, 10)
z_score(30, 50, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment