Skip to main content
Post Closed as "Duplicate" by Glen_b r
edited tags
Link
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663
Post Migrated Here from stackoverflow.com (revisions)
Source Link
Perro
  • 143
  • 1
  • 5

Statistically comparing 3 groups - Test for statistical difference

I will like to perform and statistical comparison between 3 groups, in order to determine if statistically they are different or not. My data for all of the 3 groups follows a normal distribution. I am aware that in order to test for statistical significance, one can use the t.test function in r; however, that only allows to compare two groups. So, I was wondering if there is test to test such statistical difference in these 3 groups that I have.

So far my code is the following:

groups<- read.csv("...",header=TRUE)
head(groups)
str(groups)
t.test(groups$ï..Group.A,groups$Group.B) 

Output of str(groups)

> str(groups)
'data.frame':   20 obs. of  3 variables:
 $ ï..Group.A: num  0.16 -1.32 -0.409 0.128 0.844 ...
 $ Group.B   : num  0.1673 -0.1368 1.3216 -0.0506 0.1097 ...
 $ Group.C   : num  1.852 0.707 0.338 -0.327 1.109 ...

Thank you