# ttest: Interpretation of 2-Sample t Test

Exercise template for assessing the interpretation of a randomly-generated 2-sample t test (including significance and type of alternative).

**Name:**

`ttest`

**Type:**

**Preview:**

The waiting time (in minutes) at the cashier of two supermarket chains with different cashier systems is compared. The following statistical test was performed:

```
Two Sample t-test
data: Waiting by Supermarket
t = 4.1777, df = 108, p-value = 2.996e-05
alternative hypothesis: true difference in means between group Sparag and group Consumo is greater than 0
95 percent confidence interval:
1.241878 Inf
sample estimates:
mean in group Sparag mean in group Consumo
5.419987 3.360063
```

Which of the following statements are correct? (Significance level 5%)

- True. The absolute value of the test statistic is equal to 4.178.
- True. The test aims at showing that the difference of means is larger than 0.
- False. The p-value is equal to 3e-05.
- True. The test result is significant (\(p < 0.05\)) and hence the alternative is shown that the difference of means is larger than 0.
- False. The test aims at showing that the waiting time at Sparag is longer than at Consumo.

The waiting time (in minutes) at the cashier of two supermarket chains with different cashier systems is compared. The following statistical test was performed:

```
Two Sample t-test
data: Waiting by Supermarket
t = -0.39213, df = 129, p-value = 0.6956
alternative hypothesis: true difference in means between group Sparag and group Consumo is not equal to 0
95 percent confidence interval:
-1.4113489 0.9444486
sample estimates:
mean in group Sparag mean in group Consumo
4.305275 4.538726
```

Which of the following statements are correct? (Significance level 5%)

- False. The absolute value of the test statistic is equal to 0.392.
- False. The test aims at showing that the difference of means is unequal to 0.
- True. The p-value is equal to 0.696.
- False. The test result is not significant (\(p \ge 0.05\)).
- False. The test result ist not significant (\(p \ge 0.05\)).

The waiting time (in minutes) at the cashier of two supermarket chains with different cashier systems is compared. The following statistical test was performed:

```
Two Sample t-test
data: Waiting by Supermarket
t = -2.2038, df = 114, p-value = 0.01478
alternative hypothesis: true difference in means between group Sparag and group Consumo is less than 0
95 percent confidence interval:
-Inf -0.3192428
sample estimates:
mean in group Sparag mean in group Consumo
4.199330 5.489176
```

Which of the following statements are correct? (Significance level 5%)

- True. The absolute value of the test statistic is equal to 2.204.
- True. The test aims at showing that the difference of means is smaller than 0.
- False. The p-value is equal to 0.0148.
- False. The test aims at showing that the alternative that the waiting time is shorter at Sparag than at Consumo.
- True. The test result is significant (\(p < 0.05\)) and hence the alternative is shown, that the difference of means are smaller than 0.

**Description:**

`t.test()`

in R need to be interpreted regarding significance, type of alternative, and comparison of the underlying empirical means.**Solution feedback:**

**Randomization:**

**Mathematical notation:**

**Verbatim R input/output:**

**Images:**

**Other supplements:**

*(Note that the HTML output contains mathematical equations in MathML, rendered by MathJax using ‘mathjax = TRUE’. Instead it is also possible to use ‘converter = “pandoc-mathjax”’ so that LaTeX equations are rendered by MathJax directly.)*

**Demo code:**

```
library("exams")
set.seed(403)
exams2html("ttest.Rmd", mathjax = TRUE)
set.seed(403)
exams2pdf("ttest.Rmd")
set.seed(403)
exams2html("ttest.Rnw", mathjax = TRUE)
set.seed(403)
exams2pdf("ttest.Rnw")
```