Answer: The mean is 12.
# Your code, if any.
hours = c(24, 8, 7.5, 9, 6, 7, 8, 10, 5, 6, 8, 45)
max(hours) - min(hours)
## [1] 40
quantile(hours,0.25)
## 25%
## 6.75
quantile(hours,0.50)
## 50%
## 8
quantile(hours,0.75)
## 75%
## 9.25
IQR(hours)
## [1] 2.5
Answer: Yes, it appears that 24 and 55 hours does not belong in the set. Not only does it stand out as an outlier compared to the other data, but we also know that the data is based on the number of hours per day.
boxplot(hours)
Answer: C
Answer: C and D
| Performance-enhancing shoes: | 6.4 | 6.8 | 6.3 | 7.0 | 6.5 | 6.7 | 6.6 | 6.9 | 6.3 | 7.1 | 6.8 | 7.0 | 6.5 | 6.9 | 7.1 | 6.7 | 6.4 | 6.8 |
| Traditional shoes: | 6.3 | 6.7 | 6.2 | 6.9 | 6.4 | 6.6 | 6.5 | 6.8 | 6.2 | 7.0 | 6.7 | 6.9 | 6.4 | 6.8 | 7.0 | 6.6 | 6.3 | 6.7 |
Answer: : _1 < _2. : _1 > _2 Independent test
all_shoes = c(6.4, 6.8, 6.3, 7.0, 6.5, 6.7, 6.6, 6.9, 6.3, 7.1, 6.8, 7.0, 6.5, 6.9, 7.1, 6.7, 6.4, 6.8,
6.3, 6.7, 6.2, 6.9, 6.4, 6.6, 6.5, 6.8, 6.2, 7.0, 6.7, 6.9, 6.4, 6.8, 7.0, 6.6, 6.3, 6.7)
shoe_types = c(rep("1.Performance",18),
rep("2.Traditional",18))
t.test(all_shoes~shoe_types, alternative="two.sided",mu=0, conf.level=1-0.05)
##
## Welch Two Sample t-test
##
## data: all_shoes by shoe_types
## t = 1.1302, df = 34, p-value = 0.2663
## alternative hypothesis: true difference in means between group 1.Performance and group 2.Traditional is not equal to 0
## 95 percent confidence interval:
## -0.07981187 0.27981187
## sample estimates:
## mean in group 1.Performance mean in group 2.Traditional
## 6.711111 6.611111
Answer: From the output, the test statistic is 1.1302.I can reject since p-value(=0.2663) >
Answer: For the nonparametric test, the Wilcoxon rank sum test
wilcox.test(all_shoes~shoe_types, alternative="two.sided",mu=0, conf.level=1-0.05)
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: all_shoes by shoe_types
## W = 197, p-value = 0.2722
## alternative hypothesis: true location shift is not equal to 0
seaice = read.csv(url("https://noaadata.apps.nsidc.org/NOAA/G02135/south/monthly/data/S_12_extent_v3.0.csv"))
seaice = seaice[-10, ]
Answer:: _1 < _2. : _1 > _2 parametric test Can not reject H0
colnames(seaice)
## [1] "year" "mo" "data.type" "region" "extent" "area"
mse= seaice$extent
msa= seaice$area
t.test(mse, msa, paired=TRUE,
alternative = "greater",
mu=0, conf.level = 1-0.05)
##
## Paired t-test
##
## data: mse and msa
## t = 62.186, df = 44, p-value < 2.2e-16
## alternative hypothesis: true mean difference is greater than 0
## 95 percent confidence interval:
## 3.371702 Inf
## sample estimates:
## mean difference
## 3.465333
Answer: 𝐻0:𝜇1-𝜇2 < 0 𝐻A:𝜇1-𝜇2 > 0 H0 is rejected
wilcox.test(mse, msa, paired=TRUE,
alternative = "greater",
mu=0, conf.level = 1-0.05)
## Warning in wilcox.test.default(mse, msa, paired = TRUE, alternative =
## "greater", : cannot compute exact p-value with ties
##
## Wilcoxon signed rank test with continuity correction
##
## data: mse and msa
## V = 1035, p-value = 2.678e-09
## alternative hypothesis: true location shift is greater than 0
Answer: M_1 > 9.90 M_2 < 9.90 Since p value > can not reject
mse= seaice$extent
t.test(mse, mu=9.90,
alternative = "less",conf.level=0.95)
##
## One Sample t-test
##
## data: mse
## t = 2.8184, df = 44, p-value = 0.9964
## alternative hypothesis: true mean is less than 9.9
## 95 percent confidence interval:
## -Inf 10.46504
## sample estimates:
## mean of x
## 10.254
x = rnorm( n=<number_of_observations>, mean= <true_value_of_mu>, sd = <true_value_of_sigma> )
Answer: The code doesn’t work for me.
Answer: The code doesn’t work for me.
# Code
Answer: The code doesn’t work for me.
# Code
Answer: Going over more homework or even possible example problems more frequently with the lectures would definitely help a lot for this course. Also, having practice exams would help a lot more too. I am more of a visual learner and visuals and repetition helps a lot with understanding the concepts more.