Using the pnorm() function, we can calculate the area under a given region of the normal distribution. A standard normal distribution has a mean of zero and a standard deviation of one, so I set the parameters of the function accordingly. The final step is to plug in the z-score to get a probability.
pnorm(-1.35, mean = 0, sd = 1)
## [1] 0.08850799
# draw the normal curve
curve(dnorm(x,0,1), xlim=c(-3,3), main="Normal density")
# define shaded region
from.z <- -3
to.z <- -1.35
S.x <- c(from.z, seq(from.z, to.z, 0.01), to.z)
S.y <- c(0, dnorm(seq(from.z, to.z, 0.01)), 0)
polygon(S.x,S.y, col="red")
For this problem, I used the pnorm() function again, except I set lower.tail to false since the problem wants the area greater than z = 1.48.
pnorm(1.48, mean = 0, sd = 1, lower.tail = FALSE)
## [1] 0.06943662
# draw the normal curve
curve(dnorm(x,0,1), xlim=c(-3,3), main="Normal density")
# define shaded region
from.z <- 1.48
to.z <- 3
S.x <- c(from.z, seq(from.z, to.z, 0.01), to.z)
S.y <- c(0, dnorm(seq(from.z, to.z, 0.01)), 0)
polygon(S.x,S.y, col="red")
This one is slightly trickier. This time, I calculated the area by taking the area less than z = 1.5 and subtracting it by the area less than z = -0.4. The result is the area between z = -0.4 and z = 1.5.
pnorm(1.5, mean = 0, sd = 1) - pnorm(-0.4, mean = 0, sd = 1)
## [1] 0.5886145
# draw the normal curve
curve(dnorm(x,0,1), xlim=c(-3,3), main="Normal density")
# define shaded region
from.z <- -0.4
to.z <- 1.5
S.x <- c(from.z, seq(from.z, to.z, 0.01), to.z)
S.y <- c(0, dnorm(seq(from.z, to.z, 0.01)), 0)
polygon(S.x,S.y, col="red")
Another tricky one. Absolute values can be broken down into two equations. In this case, the two equations are as follows:
Z > 2
-Z > 2
By multiplying the second equation by -1, we get:
Z < -2
(remember to flip the inequality when multiplying/dividing by a negative)
The final equations we get are:
Z < -2 and Z > 2
pnorm(-2, mean = 0, sd = 1) + pnorm(2, mean = 0, sd = 1, lower.tail = FALSE)
## [1] 0.04550026
# draw the normal curve
curve(dnorm(x,0,1), xlim=c(-3,3), main="Normal density")
# define shaded region
from.z <- -3
to.z <- -2
S.x <- c(from.z, seq(from.z, to.z, 0.01), to.z)
S.y <- c(0, dnorm(seq(from.z, to.z, 0.01)), 0)
polygon(S.x,S.y, col="red")
polygon(S.x * -1, S.y, col = "red")