TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2020W/HW04.6

Aus VoWi
Zur Navigation springen Zur Suche springen

Drug company[Bearbeiten | Quelltext bearbeiten]

Manufacturing and selling drugs that claim to reduce an individual’s cholesterol level is big business. A company would like to market their drug to women if their cholesterol is in the top 15%. Assume the cholesterol levels of adult American women can be desribed by a Normal model with a mean of 188 mg/dL and a standard deviation of 24. Use R to answer the following questions.

  • (a)  Use R to draw and label the Normal model.
  • (b)  What percent of adult women do you expect to have cholesterol levels over 200 mg/dL?
  • (c)  What percent of adult women do you expect to have cholesterol levels between 150 and 170 mg/dL?
  • (d)  Calculate the interquartile range of the cholesterol levels.
  • (e)  Above what value are the highest 15% of women’s cholesterol levels?

Hint: R commands pnorm(), qnorm(), and dnorm() are useful.

Lösungsvorschlag von Friday[Bearbeiten | Quelltext bearbeiten]

--Friday Sa 30 Jan 2021 16:51:21 CET

# Statistics and Probability HW #4
# Friday 
# Duedate: 02.11.2020

# Problem 6
# Manufacturing and selling drugs that claim to reduce an individual’s 
# cholesterol level is big business. A company would like to market their drug 
# to women if their cholesterol is in the top 15%. Assume the cholesterol levels
# of adult American women can be desribed by a Normal model with a mean of 
# 188 mg/dL and a standard deviation of 24. Use R to answer the following 
# questions.
mean <- 188
sd <- 24

# Problem 6a)
# Use R to draw and label the Normal model.
# Solution:
x <- seq(0, mean*2, length=1000)
y <- dnorm(x, mean=mean, sd=sd)
plot(x, y, type="l", lwd=1, xlab="mg/dL", ylab="")

# Problem 6b)
# What percent of adult women do you expect to have cholesterol levels over 200 
# mg/dL?
# Solution:
result_6b <- 1 - pnorm(200, mean=mean, sd=sd)
result_6b

# Problem 6c)
# What percent of adult women do you expect to have cholesterol levels between 
# 150 and 170 mg/dL?
# Solution:
result_6c <- pnorm(170, mean=mean, sd=sd) - pnorm(150, mean=mean, sd=sd)
result_6c

# Problem 6d)
# Calculate the interquartile range of the cholesterol levels.
# Solution:
result_6d <- qnorm(0.75, mean=mean, sd=sd) - qnorm(0.25, mean=mean, sd=sd)
result_6d

# Problem 6e)
# Above what value are the highest 15% of women’s cholesterol levels?
# Solution:
result_6e <- qnorm(1-0.15, mean=mean, sd=sd)
result_6e