May 2019
Beginner to intermediate
266 pages
5h 57m
English
In this hypothesis testing, you can only specify a direction to the dataset mentioned previously. Here, we will use the same function with the alternative equal to (=) instruction to switch the emphasis from a two-sided test (the default) to a one-sided test. The choices that we have are two.sided, less, or greater, and the choice can be abbreviated, as shown in the following command:
> t.test(Autompg$displacement, mu = 5, alternative = 'greater') One Sample t-testdata: Autompg$displacementt = 36.052, df = 397, p-value < 2.2e-16alternative hypothesis: true mean is greater than 595 percent confidence interval: 184.8088 Infsample estimates:mean of x 193.4259 > t.test(Autompg$displacement, mu = 5, alternative = 'two.sided') ...Read now
Unlock full access