Probability of 1 SD from average


#1
# Assign a variable 'female_avg' as the average female height.
female_avg <- 64

# Assign a variable 'female_sd' as the standard deviation for female heights.
female_sd <- 3


# To a variable named 'taller', assign the value of a height that is one SD taller than average.

taller <- female_avg + female_sd + 1



# To a variable named 'shorter', assign the value of a height that is one SD shorter than average.
shorter <- female_avg + female_sd - 1

# Calculate the probability that a randomly selected female is between the desired height range. Print this value to the console.

pnorm(taller,female_avg,female_sd) - pnorm(shorter,female_avg,female_sd)  
#> [1] 0.1612813

#2

Having trouble defining the "taller" variable. can someone hint me to the correct syntax ? thanks


#3

You'll need to define the taller variable as the average + n x sd, where n is the number of standard deviations, with which the taller variable deviates from the average.

Hope it makes sense :slight_smile:


#4

that worked. and I just subtracted for the "shorter" variable. thanks


#5
# Assign a variable 'female_avg' as the average female height.
female_avg <- 64

# Assign a variable 'female_sd' as the standard deviation for female heights.
female_sd <- 3

# To a variable named 'taller', assign the value of a height that is one SD taller than average.
taller <- female_avg + 1 * female_sd
# To a variable named 'shorter', assign the value of a height that is one SD shorter than average.
shorter <- female_avg - 1 * female_sd
# Calculate the probability that a randomly selected female is between the desired height range. Print this value to the console.
pnorm(taller,female_avg,female_sd) - pnorm(shorter,female_avg,female_sd)  

#6