Question 1 (40 points)
According to the National Association of Colleges and Employers, the average salary for a new college graduate in 2019 was $45,000. A small academic program wants to know if the average salary of its graduates is below the national mean value in 2019. If it is below the national mean value, they want to take measures to increase the starting salary of their graduates. The starting salary of 36 recent graduates of this program is stored in an R vector called “college_salary”. Copy the following text, paste it in an R studio code chunk, and run the code chunk. Afterward, you will have the vector available in your R project.
college_salary= c (45600, 51400, 35600, 42892, 48180, 51000, 39900, 40000, 48100, 42033 ,41072, 42898, 42010, 51200, 43260, 42901, 40296, 44350, 43200, 47512, 45590, 50050, 41110, 42194, 44643, 43600, 40600, 50961, 39254, 42400, 52000, 46100, 50533, 42026, 41236, 44239)
Ho: average (mean) salary of graduates >= $45,000
Ha: average (mean) salary of graduates < $ 45,000
college_salary= c (45600, 51400, 35600, 42892, 48180, 51000, 39900, 40000, 48100, 42033 ,41072, 42898, 42010, 51200, 43260, 42901, 40296, 44350, 43200, 47512, 45590, 50050, 41110, 42194, 44643, 43600, 40600, 50961, 39254, 42400, 52000, 46100, 50533, 42026, 41236, 44239)
college_salary
## [1] 45600 51400 35600 42892 48180 51000 39900 40000 48100 42033 41072 42898
## [13] 42010 51200 43260 42901 40296 44350 43200 47512 45590 50050 41110 42194
## [25] 44643 43600 40600 50961 39254 42400 52000 46100 50533 42026 41236 44239
mean(college_salary)
## [1] 44442.78
sd(college_salary)
## [1] 4124.048
Just because the sample mean is less than $45,000 it does not mean that, at the population level (all the salaries), the average is less than $45,000. We need to figure out is $44,442 is sufficiently far away from $45,000. The test statistic and the p-value will tell us.
t.test(college_salary, alternative = c("less"), mu=45000)
##
## One Sample t-test
##
## data: college_salary
## t = -0.81069, df = 35, p-value = 0.2115
## alternative hypothesis: true mean is less than 45000
## 95 percent confidence interval:
## -Inf 45604.09
## sample estimates:
## mean of x
## 44442.78
Conclusion: p-value = 0.2115 > alpha (0.05); therefore, we fail reject Ho.
Question 2 (60 points) Researchers at a Zoo wish to test the efficacy of a new program intended to reduce the length of labor in female pumas (i.e., mountain lions). From historical records, researchers know that it takes an average of 60 minutes for a female puma to give birth to a litter. The new program was tested with 25 puma mothers that gave birth. The data of the length of labor (in minutes) for these 25 puma mothers is shown below.
puma_labor= c(56, 51, 62, 58, 59, 59, 56, 56, 54, 47, 51, 64, 48, 59, 59, 53, 61, 55, 57, 63, 55, 56, 62, 57, 55)
puma_labor= c(56, 51, 62, 58, 59, 59, 56, 56, 54, 47, 51, 64, 48, 59, 59, 53, 61, 55, 57, 63, 55, 56, 62, 57, 55)
puma_labor
## [1] 56 51 62 58 59 59 56 56 54 47 51 64 48 59 59 53 61 55 57 63 55 56 62 57 55
round(mean(puma_labor))
## [1] 57
sd(puma_labor)
## [1] 4.360046
Ho: average (mean) labor >= 60 minutes
Ha: average (mean) labor < 60 minutes
The P value.
t.test(puma_labor, alternative= c("less"), mu=60)
##
## One Sample t-test
##
## data: puma_labor
## t = -3.9908, df = 24, p-value = 0.0002697
## alternative hypothesis: true mean is less than 60
## 95 percent confidence interval:
## -Inf 58.0119
## sample estimates:
## mean of x
## 56.52
Conclusion: p-value = 0.0002697 < alpha (0.05); We reject Ho (and support Ha)
Note: Challenge questions are those I want you to answer without getting any help from me (i.e., you cannot ask me how to answer them). It is only 10 points; thus, do not worry. Try your best to answer it.
What type of statistical error could you potentially be making after your decision in part c? Is the probability that you are making this type of error small or large? Justify the answers to both of these questions.
It is a Type 1 error because we reject Ho and Ho could be true. The probability shows an small error due to alpha is 0.05 and we get a value lower than 0.05.