Self-Check Questions (ungraded)

hypothesis testing

Aidong Adam Ding
Made using Slidify in R. (Click mouse then right arrow key for next slide.)

Question 1

We have two random samples \({X_1}\), ..., \({X_{12}}\) and \({Y_1}\), ..., \({Y_{12}}\) from two populations. We want to show that the mean of Ys are greater than the mean of Xs.

What are the null hypothesis and the alternative hypothesis?

  1. \(H_0: \mu_X=\mu_Y\) versus \(H_A: \mu\neq 160\)

  2. \(H_0: \mu_X=\mu_Y\) versus \(H_A: \mu_X=\mu_Y\)

  3. \(H_0: \mu_X<\mu_Y\) versus \(H_A: \mu_X=\mu_Y\)

  4. \(H_0: \mu_X=\mu_Y\) versus \(H_A: \mu_X>\mu_Y\)

  5. \(H_0: \mu_X=\mu_Y\) versus \(H_A: \mu_X<\mu_Y\)

Recall that we set the alternative hypothesis \(H_A\) as what we want to prove.

The correct setup is \(H_0: \mu_X=\mu_Y\) versus \(H_A: \mu_X<\mu_Y\).

The claim that we wish to prove \((\mu_X<\mu_Y)\) is always the alternative hypothesis.

Question 2

We have two random samples \({X_1}\), ..., \({X_{120}}\)and \({Y_1}\), ..., \({Y_{120}}\) from two populations. The data are stored in two vectors x and y respectively. We wish to test if the two population means equal to each other.

Which of the following R command would be the best to produce the test?

  1. var.test(x,y)
  2. t.test(x,y,var.equal=T )
  3. t.test(x~y)
  4. t.test(x-y)
  5. var.test(x~y)
  6. t.test(x)-t.test(y)

4 t.test(x-y) is Correct. This does the paired t-test.

1: var.test(x,y) tests if the variances equal, not the means equal.

2: t.test(x,y,var.equal=T ) is the unpaired t-test assuming equal variance. Since we do not know if the variances are same, the general t-test without equal variances assumption should be used. Also, here we can use paired t-test, which usually is better than unpaired t-test.

3: t.test(x~y) is wrong: y is not a group indicator variable here. So wrong syntax.

5: var.test(x~y) is wrong. Wrong syntax, and testing the wrong hypothesis (on variance instead on means).

6: t.test(x)-t.test(y) is of wrong syntax. The minus of two t-tests have no meaning.