3
$\begingroup$

How to run a t-test for two groups with one group including only one value?

Example:

group A: 7, 8, 9 
group B: 5
$\endgroup$
3
  • 1
    $\begingroup$ This can be done only if you assume the two groups have the same variance. But the test would be very weak. $\endgroup$ Commented Feb 27, 2018 at 2:47
  • $\begingroup$ @MichaelChernick With this assumption, it will be t.test(7:9, mu=5)? Thank you. $\endgroup$ Commented Feb 27, 2018 at 2:58
  • 1
    $\begingroup$ $\mu$ is unknown and not necessarily 5. But 5 would be the estimate of the group B mean and 8 the estimate of the group A mean. $\endgroup$ Commented Feb 27, 2018 at 5:28

1 Answer 1

6
$\begingroup$

No, your suggested code is quite wrong.

The fact that there is only one observation for group B is not a problem for the standard two-sample t-test. You just run it in R in the usual way:

A <- c(7,8,9)
B <- 5
t.test(A, B, var.equal=TRUE)

The option var.equal=TRUE tells t.test() to perform the traditional two-sample t-test with pooled variance. In this case, the population variance is estimated from group A alone since replicates for group B are not available. The t-test will be on 2 degrees of freedom.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.