In: Math
Is there enough evidence in the data that population average price of diamond for color “E” is more than 1500?
Solve in R using the t test.
| Color | Price |
| D | 1302 |
| E | 1510 |
| G | 1510 |
| G | 1260 |
| D | 1641 |
| E | 1555 |
| F | 1427 |
| G | 1427 |
| H | 1126 |
| I | 1126 |
| F | 1468 |
| G | 1202 |
| E | 1327 |
| I | 1098 |
| E | 1693 |
| F | 1551 |
| G | 1410 |
| G | 1269 |
| H | 1316 |
| H | 1222 |
| E | 1738 |
| F | 1593 |
| G | 1447 |
| H | 1255 |
| F | 1635 |
| H | 1485 |
| F | 1420 |
| H | 1420 |
| F | 1911 |
| H | 1525 |
| F | 1956 |
| H | 1747 |
| I | 1572 |
| E | 2942 |
| G | 2532 |
| E | 3501 |
| E | 3501 |
| F | 3501 |
| F | 3293 |
| G | 3016 |
| F | 3567 |
| G | 3205 |
| D | 3490 |
| E | 3635 |
| F | 3635 |
| F | 3418 |
| D | 3921 |
| F | 3701 |
| F | 3480 |
| G | 3407 |
| E | 3767 |
| F | 4066 |
| E | 4138 |
| F | 3605 |
| G | 3529 |
| F | 3667 |
| I | 2892 |
| G | 3651 |
| G | 3773 |
| F | 4291 |
| E | 5845 |
| G | 4401 |
| G | 4759 |
| H | 4300 |
| F | 5510 |
| G | 5122 |
| H | 5122 |
| I | 3861 |
| F | 5881 |
| F | 5586 |
| F | 5193 |
| H | 5193 |
| F | 5263 |
| I | 5441 |
| I | 4948 |
| H | 5705 |
| F | 6805 |
| H | 6882 |
| H | 6709 |
| I | 6682 |
| E | 3501 |
| G | 3432 |
| F | 3851 |
| H | 3605 |
| E | 3900 |
| H | 3415 |
| H | 4291 |
| E | 6512 |
| E | 5800 |
| F | 6285 |
####Import the given file from Excel to R#####
>library(readxl)
>t_test <-
read_excel("C:/Users/Admin/Desktop/t_test.xlsx")
>View(t_test)
####Now to extract the rows for E########
>install.packages("dplyr")
>library(dplyr)
>t=t_test %>% filter(Color=="E")
#######Performing t-test######
###Null Hypothesis: Mean=1200
###Alternate: Mean>1200
#### At 95% level of sognificance
>t.test(t$Price, mu=1500, alternative="greater",conf.level = 0.95)
Results from R is given as-

Based on the above results we have
t = 4.75, df = 15, p-value = 0.000129
since the p-value is less than 0.05(alpha value), therefore we have enough evidence to reject the null hypothesis that the average price of diamond for color “E” is more than 1500.
Thanks