3. Use R Studio: Include R Code A commuter records 20 commute times to gage her median commute time. The data has a sample median of 24 and is summarized in this stem-and-leaf diagram: stem(commutes)
2 | 111233444444
2 | 55569
3 | 113
If the data is appropriate for t.test, use that to compute a 90% confidence interval for the median. Otherwise use wilcox.test (perhaps after a transform) to compute a confidence interval for the median.
>
x=c(21,21,21,22,23,23,24,24,24,24,24,24,25,25,25,26,29,31,31,33)
> #Checking for normality of the data
> qqnorm(x)
> qqline(x)
>
> #Since the data is not normal, we cannot perform the t
test
>
> #Introducing some randomness in the data
> y=jitter(x)
>
> #Performing the Wilcoxon test
> wilcox.test(y)
Wilcoxon signed rank test
data: y
V = 210, p-value = 1.907e-06
alternative hypothesis: true location is not equal to 0
Get Answers For Free
Most questions answered within 1 hours.