# Let's find the SD first
sd <- sqrt(40000)
# the mean weight is 1300
m <- 1300
## Using pnorm, q=979
# since we want the area above the weight of 979, we must subtract the value of the pnorm function
round(1-pnorm(q=979, mean=m, sd=sd),4)
## [1] 0.9458
# the z score is (979-1300)/sd
z<- (979-1300)/sd
##
## we could also use a z look-up table
## using 1-pnorm(-1.605), we can get the prob
round(1-pnorm(-1.605),4)
## [1] 0.9458
## Given: v=1,960,000, mean=11,000, find P>8340
v<-1960000
m<-11000
sd <- sqrt(v)
## the prob thatan SVGA lifespan is be more than 8340
round(1-pnorm(q=8340,mean=m,sd=sd),4)
## [1] 0.9713
## [1] 0.7260243
## given: mean = 80, sd = 3, find P(83 <=x <= 85)
## we need to find the difference between the curve
m <- 80
sd <- 3
### find prob below 85 million
prob_below85=pnorm(q=85,mean=m,sd=sd)
### find prob below 83 million
prob_below83=pnorm(q=83,mean=m,sd=sd)
## Answer: find the prob between 85 and 83
round(prob_below85-prob_below83,4)
## [1] 0.1109
# set given values
sd <- 123
m <-456
top_14 <- 1-.14
## We need to find the Z value for P=.86
#using a look-up table, we get 1.08
## we can also use qnorm to get the Z value for p=.86
z <- qnorm(.86)
z
## [1] 1.080319
## we can use the formula
# z = (x - mean) / sd
# z*sd+mean = x
## this is the minimal value needed to geet into the university
z*sd+m
## [1] 588.8793
## we could also pass parameters to qnorm to get the same answer
round(qnorm(.86, mean = m, sd = sd))
## [1] 589
### Given m=6.13, we need to find the z values for the top and bottom 7%
m=6.13
sd=0.06
## bottom 7% length value
round(qnorm(.07,mean = m, sd= sd),2)
## [1] 6.04
## top 7% length value
round(qnorm(1-.07, mean=m,sd=sd),2)
## [1] 6.22
## These are the limits that the needs should conform to.
# We need to find the x values for the top and bottom limit of Z
## top limit of C
m <- 78.8
sd <- 9.8
round(qnorm(1-.45, mean=78.8,sd=sd))
## [1] 80
## bottom limit of C
round(qnorm(.20, mean=78.8,sd=sd))
## [1] 71
# given m=21.2, sd=5.4.
# want top .45
## top .45 find the value at .55
m=21.2
sd=5.48
round(qnorm(1-.45, mean=m,sd=sd),1)
## [1] 21.9
Could not figure how to solve this one out
# mean_pop = 48
# SD_pop = 7
# sample_n = 147
mean_pop <- 48
sample_n <- 147
SD_pop <- 7
## we need to find the SD of the sample size
SD_sample <- SD_pop/sqrt(sample_n)
SD_sample
## [1] 0.5773503
# let's find the probability that the mean of the same is greater than 48.83
# we use 1 - the answer because the current formula will give us the prob area below.
round(1 - pnorm(48.83, mean=mean_pop, sd=SD_sample),4)
## [1] 0.0753
# we can also use
round(pnorm(48.83, mean=mean_pop, sd=SD_sample, lower.tail = FALSE),4)
## [1] 0.0753
# Given: pop_mean, pop_sd, n_sample=68, find(P > 93.54)
pop_mean <- 91
pop_sd <- 10
n_sample <- 68
SD_sample <- 10/sqrt(n_sample)
round(pnorm(93.54,mean=pop_mean,sd=SD_sample, lower.tail = FALSE),4)
## [1] 0.0181
# Using the following sqrt(npq) and mean=np
p_no_shows <- .07
p_do_shows <- .93
sample_n <- 540
## expected no shows?
m_sample <- sample_n*p_no_shows
sd_sample <- sqrt(sample_n * p_no_shows * p_do_shows)
sd_sample
## [1] 5.929081
## Prob that prop no shows < 3%
## 3% of the sample is .03 * 540
three_percent <- sample_n * .03
pnorm(three_percent, mean = m_sample, sd= sd_sample)
## [1] 0.0001347078
A bottle maker believes that 23% of his bottles are defective. If the bottle maker is accurate, what is the probability that the proportion of defective bottles in a sample of 602 bottles would differ from the population proportion by greater than 4%? (Round your answer to 4 decimal places) Could not figure out how to solve this one
A research company desires to know the mean consumption of beef per week among males over age 48. Suppose a sample of size 208 is drawn with x ̅ = 3.9 AssuesSD = 0.8 . Construct the 80% confidence interval for the mean number of lb. of beef per week among males over 48. (Round your answers to 1 decimal place)
m <- 3.9
SD <- 0.8
n = 208
SE <- (SD/sqrt(208))
# we will use a one tail test, which means that for an 80% confidence interval, we must divide .20/2
## qt will give the t
#QT can be used to find the Z value that needs to be used. In this case, we will supply N-1 degrees of freedom or 207
qt(1-.10,207)
## [1] 1.285655
## We use .90 because we want 5% at each end, with 207 used for degrees of Freedom
t <- qt(.20/2,207, lower.tail = FALSE)
bottom_limit <-m-t*SE
round(bottom_limit,1)
## [1] 3.8
upper_limit <- m+t*SE
round(upper_limit,1)
## [1] 4
#Using the same process above, we need to find the standard error - SE
# the DF will be 7471
m <- 16.6
SD <- 11
n <- 7472
df <- n -1
SE <- (SD/sqrt(n))
# We are using a one proporation test, therefore .02 must be divided by 2
t <- qt(.02/2,df, lower.tail = FALSE)
### Bottom Limit
bottom_limit <-m-t*SE
round(bottom_limit,1)
## [1] 16.3
## Upper limit
upper_limit <- m+t*SE
round(upper_limit,1)
## [1] 16.9
## we can use the QT function in R or a T Student table. Using a one-sided tail, we divide .05 by 2.
qt(0.05/2, 26, lower.tail = FALSE)
## [1] 2.055529
Step 1. Calculate the sample mean for the given sample data. (Round answer to 2 decimal places)
Step 2. Calculate the sample standard deviation for the given sample data. (Round answer to 2 decimal places)
Step 3. Find the critical value that should be used in constructing the confidence interval. (Round answer to 3 decimal places)
Step 4. Construct the 90% confidence interval. (Round answer to 2 decimal places)
values <- c(383.6,347.1,371.9,347.8,325.8,337)
mean <- mean(values)
sd <- sd(values)
n <- length(values)
# find the standard error
se <- sd/sqrt(n)
df = n - 1
# find the t value
t <- qt(.10/2,df, lower.tail = FALSE)
t
## [1] 2.015048
## construct the 90% confidence interval
### Bottom Limit
bottom_limit <-mean-t*se
round(bottom_limit,2)
## [1] 334.38
## Upper limit
upper_limit <- mean+t*se
round(upper_limit,2)
## [1] 370.02
Step 1. Find the critical value that should be used in constructing the confidence interval. (Round answer to 3 decimal places)
Step 2. Construct the 80% confidence interval. (Round answer to 1 decimal place)
n <- 16
mean <- 46.4
sd <- 2.45
se <- sd / sqrt(n)
se
## [1] 0.6125
t<qt(.10, n - 1, lower.tail = FALSE)
## [1] FALSE
## Bottom Limit
bottom_limit <-mean-t*se
round(bottom_limit,1)
## [1] 45.2
## Upper limit
upper_limit <- mean+t*se
round(upper_limit,1)
## [1] 47.6
# z value for 99 confidence
z <- qnorm(.01/2, lower.tail = FALSE)
me <- 0.13
sd < 1.9
## [1] FALSE
## n = (z * (s/ME))^2
## Reference Stats and Data Models, p534
n <- (z * sd / me)^2
round(n)
## [1] 2357
m <- 12.6
v <- 3.61
sd <-sqrt(v)
## find z for 95 confidence. We will usee a one-tail proporation so
z <- qnorm(.05/2, lower.tail = FALSE)
me <- 0.19
## Using the formula n
## n = (z * (s/ME))^2
## Reference Stats and Data Models, p534
n <- (z * sd / me)^2
round(n)
## [1] 384
Step 1. Suppose a sample of 2089 tenth graders is drawn. Of the students sampled, 1734 read above the eighth grade level. Using the data, estimate the proportion of tenth graders reading at or below the eighth grade level. (Write your answer as a fraction or a decimal number rounded to 3 decimal places)
sample_n <- 2089
read_above_8th <- 1734
read_at_or_below <- (sample_n - read_above_8th)/sample_n
round(read_at_or_below,3)
## [1] 0.17
Step 2. Suppose a sample of 2089 tenth graders is drawn. Of the students sampled, 1734 read above the eighth grade level. Using the data, construct the 98% confidence interval for the population proportion of tenth graders reading at or below the eighth grade level. (Round your answers to 3 decimal places) p <- 0.17 q <- 1 - p
## Using the sampling distribution model for a proporation SD = sqrt(p*q/n)
# We get the following
p <- 0.17
q <- 1 - p
n = 2089
se <- sqrt(p*q/n)
# m +- z*se
z <- qt(.02/2, n - 1, lower.tail = FALSE)
z
## [1] 2.328135
#top_bound
top<- p + z * se
round(top,3)
## [1] 0.189
#lower_bound
bottom<- p - z * se
round(bottom,3)
## [1] 0.151
Step 1. Suppose a sample of 474 tankers is drawn. Of these ships, 156 had spills. Using the data, estimate the proportion of oil tankers that had spills. (Write your answer as a fraction or a decimal number rounded to 3 decimal places)
n<-474
p.spills <- 156/n
q.no_spills <- 1 - p.spills
# proportion of oil tanks that had spills
round(p.spills,3)
## [1] 0.329
Step 2. Suppose a sample of 474 tankers is drawn. Of these ships, 156 had spills. Using the data, construct the 95% confidence interval for the population proportion of oil tankers that have spills each month. (Round your answers to 3)
#
n<-474
p.spills <- 156/n
q.no_spills <- 1 - p.spills
se <- sqrt(p.spills*q.no_spills/n)
# the standard error using SQRT(pq/n)
z <- qt(.05/2, n - 1, lower.tail = FALSE)
## upper bound
upper <- p.spills - z * se
round(upper, 3)
## [1] 0.287
## lower bound
lower <- p.spills + z * se
round(lower,3)
## [1] 0.372