aliens <- read.csv ("aliens.csv", header = TRUE, stringsAsFactors = TRUE)
library(skimr)
source('special_functions.R')
pnorm(8, mean = 11, sd = 2)
## [1] 0.0668072
• Find the probability that a randomly selected person who takes the IQ test gets a score lower than 75.
pnorm(75, mean = 100, sd = 15)
## [1] 0.04779035
• Find the probability that a randomly selected person scores lower than 120.
pnorm(120, mean = 100, sd = 15)
## [1] 0.9087888
Based on what you got in problem 1, what’s the probability that a person’s score is: • greater than or equal to 75? .06 • greater than or equal to 120? .1
The label very superior intelligence is often used for those with IQ between 120 and 140. What’s the probability of a person falling into this category?
pnorm(120, 140, mean = 100, sd = 15)
## [1] 0.9087888
The function qnorm does the same thing in reverse: You give it a cumulative probability, and it tells you the value that has this probability to its left. For example, to get the value from the N(11, 2) distribution that has .07 of the distribution to its left, you’d use this:
qnorm(.07, mean = 11, sd = 2)
## [1] 8.048418
Find the two values that mark the 80th and 90th percentiles of the IQ distribution.
qnorm(.90, mean = 100, sd = 15)
## [1] 119.2233
qnorm(.80, mean = 100, sd = 15)
## [1] 112.6243
In class, you learned the formula to compute a z-score. You can use R as a calculator to implement this formula. • What would be the z-score associated with an IQ score of 140?
(140-100)/(15)
## [1] 2.666667
• What would be the z-score associated with an IQ score of 95?
(95-100)/(15)
## [1] -0.3333333
Here’s some code that shows the density function for the IQ distribution. The first line just makes a variable called IQ, that goes from 50 to 150, counting by 1’s. The second line actually makes the plot. Note that the “l” is the lowercase letter l, not the number 1.
IQ <- seq(50, 150, 1)
plot(IQ, dnorm(IQ, 100, 15), type = "l")
60 80 100 120 140 0.000 0.010 0.020
IQ
## [1] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
## [19] 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
## [37] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
## [55] 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
## [73] 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
## [91] 140 141 142 143 144 145 146 147 148 149 150
dnorm(IQ, 100, 15)
## [1] 0.0001028186 0.0001281199 0.0001589392 0.0001962978 0.0002413624
## [6] 0.0002954566 0.0003600704 0.0004368688 0.0005276968 0.0006345818
## [11] 0.0007597324 0.0009055313 0.0010745239 0.0012694000 0.0014929687
## [16] 0.0017481259 0.0020378140 0.0023649729 0.0027324837 0.0031431044
## [21] 0.0035993978 0.0041036534 0.0046578051 0.0052633439 0.0059212307
## [26] 0.0066318093 0.0073947223 0.0082088348 0.0090721655 0.0099818310
## [31] 0.0109340050 0.0119238944 0.0129457370 0.0139928197 0.0150575218
## [36] 0.0161313816 0.0172051884 0.0182690978 0.0193127702 0.0203255285
## [41] 0.0212965337 0.0222149735 0.0230702595 0.0238522286 0.0245513427
## [46] 0.0251588818 0.0256671250 0.0260695129 0.0263607894 0.0265371151
## [51] 0.0265961520 0.0265371151 0.0263607894 0.0260695129 0.0256671250
## [56] 0.0251588818 0.0245513427 0.0238522286 0.0230702595 0.0222149735
## [61] 0.0212965337 0.0203255285 0.0193127702 0.0182690978 0.0172051884
## [66] 0.0161313816 0.0150575218 0.0139928197 0.0129457370 0.0119238944
## [71] 0.0109340050 0.0099818310 0.0090721655 0.0082088348 0.0073947223
## [76] 0.0066318093 0.0059212307 0.0052633439 0.0046578051 0.0041036534
## [81] 0.0035993978 0.0031431044 0.0027324837 0.0023649729 0.0020378140
## [86] 0.0017481259 0.0014929687 0.0012694000 0.0010745239 0.0009055313
## [91] 0.0007597324 0.0006345818 0.0005276968 0.0004368688 0.0003600704
## [96] 0.0002954566 0.0002413624 0.0001962978 0.0001589392 0.0001281199
## [101] 0.0001028186
Make three more plots, which show what the density function would look like if: • the mean was 120, rather than 100
IQ <- seq(50, 150, 1)
plot(IQ, dnorm(IQ, 120, 15), type = "l")
• the standard deviation was 10, rather than 15
IQ <- seq(50, 150, 1)
plot(IQ, dnorm(IQ, 100, 10), type = "l")
• the mean was 120 and the standard deviation was 10
IQ <- seq(50, 150, 1)
plot(IQ, dnorm(IQ, 120, 10), type = "l")
Examine the distribution of intelligence in the population of aliens. • Does this variable appear to be Normally distributed? Make a histogram to check. Yes it does appear to be normally distributed.
aliens <- seq(50, 150, 1)
plot (aliens, dnorm(aliens, 100, 15), type = "l")
• Is the mean similar to the human mean? The human mean is 100, and the
aliens mean is 100. • Is the standard deviation similar to the human
standard deviation? Yes, the human mean and alien standard deviation is
similar, both are 15. ## Question 8 Who is smarter, relative to their
own species’ IQ distribution: A human with an IQ of 120, or an alien
with an IQ of 120? Show how you determined this, and explain it in
words. (Hint: Use z-scores!) They are equally intelligent. I determined
this by subtracting the value by the mean, and dividing by the standard
deviation.
aliens
## [1] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
## [19] 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
## [37] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
## [55] 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
## [73] 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
## [91] 140 141 142 143 144 145 146 147 148 149 150
(120-100)/(15)
## [1] 1.333333
IQ
## [1] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
## [19] 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
## [37] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
## [55] 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
## [73] 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
## [91] 140 141 142 143 144 145 146 147 148 149 150
(120-100)/(15)
## [1] 1.333333
There is a very interesting phenomenon related to IQ called the Flynn effect. For reasons that we don’t fully understand, mean IQ scores rose throughout the twentieth century, by about three points per decade. But IQ tests have been constantly re-adjusted to account for this, keeping 100 as the mean. So, a person who scored 100 in 1920 would actually score much lower than 100 on the 1980 test, because the test was made harder by about 3 points per decade; and a person who scored 100 in 1980 would score much higher than 100 on the 1920 test, because the 1920 test was easier. In the movie Back to the Future, two characters, Marty McFly and Doc Brown, travel back in time from 1985 to 1955.
Imagine that each of them took an IQ test right before they left: Marty scored 115, and Doc scored 160. If they then each took an IQ test in 1955, what would they have scored? 106, 151 What would their z-scores be in 1985, and in 1955?
IQ
## [1] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
## [19] 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
## [37] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
## [55] 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
## [73] 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
## [91] 140 141 142 143 144 145 146 147 148 149 150
(115-110.5)/(6.36)
## [1] 0.7075472
(160-155)/(6.36)
## [1] 0.7861635
What would their IQ percentile scores be in 1985? 84,99 what would their IQ percentile scores 1955? 65, 100