0
$\begingroup$

We know that a t-test is just a special case of ANOVA, so I tried to reproduce the result of the following t-test with aov() or anova(lm())

A <- c(56,65,69,78,72,82,81,87,89,81)
B <- c(78,88,89,91,84,87,92,94,92,90)

t.test(A,B,var.equal=TRUE)

I get different p-values, no matter what parameter combinations I try - please help!

$\endgroup$
2
  • $\begingroup$ The sample variance of A is 107.3, and the sample variance of B is 21.8. Why are you assuming that the variances are equal? $\endgroup$
    – Alexis
    Commented Aug 28, 2014 at 15:54
  • $\begingroup$ @Alexis: There is no special reason, I am only trying to reproduce the results of a paper with R. $\endgroup$
    – vonjd
    Commented Aug 28, 2014 at 16:46

1 Answer 1

5
$\begingroup$

I don't really see the problem. For me

t.test(A,B,var.equal=TRUE)

and

summary(aov(c(A,B)~rep(c("A","B"),each=10)))

and

anova(lm(c(A,B)~rep(c("A","B"),each=10)))

all result in $p=0.00268$.

$\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.