Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

How would I use ANOVA to find the differences between means of three groups in a dataset

$
0
0

I am trying to use ANOVA to find the differences between means of only 'group1', 'group2' and 'group5' in the below dataset.

tab_csv <- read.csv("data.csv", sep = "\t", header = TRUE)
tab_csv

    label   number
1  group1    120
2  group1    105
3  group1    105
4  group1     84
5  group1     32
6  group2    820
7  group2    922
8  group2    823
9  group2    945
10 group2    849
11 group3    1990
12 group3    29
13 group3    40
14 group3    21
15 group3    900
16 group4    220
17 group4    70
18 group4    109
19 group4    19
20 group4    18
21 group5    55
22 group5    40
23 group5    35
24 group5    30
25 group5    20

levels(tab_csv$label)
[1] "group1""group2""group3""group4""group5"

I have started by trying this but I am not sure...

tab_csv$number[tab_csv$label == "group1"])
tab_csv$number[tab_csv$label == "group2"])
tab_csv$number[tab_csv$label == "group5"])

Could anyone please help?


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>