-1

I have to make ANOVA in R using build-in packages, my data seems like this :

dane=cbind(a=rnorm(10),b=rnorm(10),c=c(1,1,1,1,2,2,2,2,2,2))

a and b are variables for which I want to test hypothesis about equality of means in groups assigned by c variable. My case is the simplest case when t-test is not enough.

1

1 Answer 1

1
dane <- data.frame(dane)
with(dane, aov(c(a[c==1],b[c==2]) ~ c))

Or, if you mean to test both a and b as separate dvs:

with(dane, aov(a ~ c))
with(dane, aov(b ~ c))
0

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.