Below are Pratice questions: Practice: 4.3, 4.13, 4.23, 4.25, 4.39, 4.47
A college counselor is interested in estimating how many credits a student typically enrolls in each semester. The counselor decides to randomly sample 100 students by using the registrar’s database of students. The histogram below shows the distribution of the number of credits taken by these students. Sample statistics for this distribution are also provided.
The point estimate for mean : 13.65 The point estimate for median : 14
The point estimate for SD : 1.91 The point estimate for IQR : Q3-Q1 = 15-13 = 2
The approximate 95% confidence interval is ( 13.65 - 2 * SD , 13.65 + 2* SD ) = (9.83, 17.47)
So a load of 16 is not an unusal credit as per the 95% confidence level. But 18 is not, since it is outside of the confidence level.
confidence_lower_range <- 13.65 -2 * 1.91
confidence_upper_range <- 13.65 + 2 * 1.91
No, this is under the confidence level. This could be due to the sampling error.
(Hint: recall that SD¯x = ! pn )? Compute this quantity using the data from the original sample.
Standard error can be used to quantify the variability of the estimate. = 0.19
SE <- 1.91/sqrt(100)
SE
## [1] 0.191
A hospital administrator hoping to improve wait times decides to estimate the average emergency room waiting time at her hospital. She collects a simple random sample of 64 patients and determines the time (in minutes) between when they checked in to the ER until they were first seen by a doctor. A 95% confidence interval based on this sample is (128 minutes, 147 minutes), which is based on the normal model for the mean. Determine whether the following statements are true or false, and explain your reasoning. #### (a) This confidence interval is not valid since we do not know if the population distribution of the ER wait times is nearly Normal.
This can be true or false since there is no indication on the skewness.
If the distribution is normal and since the no of sample is greater than 30, confidence is valid. But if the distribution has some skewness and since the no of sample is less than 100, the confidence range can be go invalid.
between 128 and 147 minutes.
False, confidence interval is an estimate of the population based on the sample. It cant be really apply on samples.
room is between 128 and 147 minutes.
True, based on above qn reasoning.
False, confidence interval is an estimate of the population based on the sample. It cant be really apply on samples.
to be more sure of our estimate.
False. it would be broader because it would be taking into account more possibilities.
True
sample_mean <- (128 + 147)/2
sample_mean
## [1] 137.5
margin <- 147 - sample_mean
margin
## [1] 9.5
we would need to double the sample size.
you would need to make the sample size 4 times in order to decrease the margin of error.
The nutrition label on a bag of potato chips says that a one ounce (28 gram) serving of potato chips has 130 calories and contains ten grams of fat, with three grams of saturated fat. A random sample of 35 bags yielded a sample mean of 134 calories with a standard deviation of 17 calories. Is there evidence that the nutrition label does not provide an accurate measure of calories in the bags of potato chips? We have verified the independence, sample size, and skew conditions are satisfied.
H0 -> Null Hypothesis => mu = 130 HA -> Alternate Hypothesis => mu not equal 130
calculate the z value of the sampled mean.
z <- (134 - 130)/(17/sqrt(35))
z
## [1] 1.392019
calculate the pvalue( both tail and head part )
pvalue <- pnorm(z, lower.tail=FALSE)
totalPval <- pvalue + pvalue
totalPval
## [1] 0.1639167
Since the total p val = 0.1639167 and it is greater than alpha(.05), we can not reject null hyposthesis. Hence there is no evidence that the nutrition label does not provide an accurate measure of calories in the bags of potato chips.
The hospital administrator mentioned in Exercise 4.13 randomly selected 64 patients and measured the time (in minutes) between when they checked in to the ER and the time they were first seen by a doctor. The average time is 137.5 minutes and the standard deviation is 39 minutes. She is getting grief from her supervisor on the basis that the wait times in the ER has increased greatly from last year’s average of 127 minutes. However, she claims that the increase is probably just due to chance.
Independence -> since it is random sample, it satisfies the independence conditions. Sample Size -> Since the number of samples is more than 30, it satisfies the sample size Distrubition -> Since there is no information on skewness, I’m assuming that the distrubution is not strongly skewed.
Since two sided test, pvalue is calcualted as 0.03 which is less than the significance level(0.05). So null hypotesis is rejected.
z <- (137.5 - 127)/(39/sqrt(64))
z
## [1] 2.153846
pvalue <- 2*(1- pnorm(z))
pvalue
## [1] 0.03125224
Yes, in this case the null hypothesis is failed to reject.
The distribution of weights of United States pennies is approximately normal with a mean of 2.5 grams and a standard deviation of 0.03 grams.
0.04%
mean = 2.5
sd = 0.03
#using the Z score formula
z <- (2.4-mean)/sd
pnorm(z)
## [1] 0.0004290603
sampling distribution of 10 samples is approximately normal with standard error = 0.009
n= 10
SampleD <- sd/(sqrt(n))
SampleD
## [1] 0.009486833
The probabily is nearly 0.
pnorm(2.4,mean = 2.5,sd = SampleD)
## [1] 2.797279e-26
normsample <- seq(mean - (3 * sd), mean + (3 * sd), length=15)
randomsample<- seq(mean - (3 * SampleD), mean + (3 * SampleD), length=15)
popDist <- dnorm(normsample,mean,sd)
sampleDist<- dnorm(randomsample,mean,SampleD)
plot(normsample, popDist, type="l",col="blue", ylim=c(0,75), xlab = "Weights", ylab = "Frequency")
lines(randomsample, sampleDist, col="red")
#### (e) Could you estimate the probabilities from (a) and (c) if the weights of pennies had a skewed distribution?
We can not find the probability accuratly for (a) since the distrubution is skewed. We can find the probability for (c) if we have no of samples is greater than 100 since it is skewed. But with samples 10, it is not possible.