May 2019
Beginner to intermediate
266 pages
5h 57m
English
In hypothesis testing, you can only specify a direction to the dataset specified. Here, we will use the same function with the alternative equal to the (=) instruction to switch the emphasis from a two-sided test (default) to a one-sided test. The choices available to us are two-sided, less, or greater, and this choice can be abbreviated, as shown in the following command:
> t.test(AirQualityUCI$RH, mu = 5, alternative = 'greater') One Sample t-test data: AirQualityUCI$RH t = 65.13, df = 9356, p-value < 2.2e-16 alternative hypothesis: true mean is greater than 5 95 percent confidence interval: 38.61264 Inf sample estimates: mean of x 39.48361 > t.test(AirQualityUCI$AH, mu = 5, alternative = 'greater') One Sample ...
Read now
Unlock full access