0

The data looks as follows:

> data <- read.csv("data.csv")
> head(data)
  ï..class.1    rev.1 class.2    rev.2
1          7 136.9900    1318  31.9900
2       1223  24.0984    1001   0.0000
3       1318  61.9900    6851 104.2655
4       1014  39.9800    1318  29.9800
5          7  32.9800    7     52.9900
6        291 107.6674     797  31.2741

I want to perform a significance test to compare the means of rev.1 and rev.2 ONLY where groups class.1=class.2. I tried doing this with ANOVA but am having issues only comparing the groups that I want. Any guidance would be greatly appreciated!

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294
Sharkbait
  • 1
  • 1
  • 1
    Why don't you use `Tukey's` pairwise differences for this, as is advocated in almost every undergraduate Statistics major? Also, this should go under the `stats` stack exchange thread. – InfiniteFlash Dec 27 '17 at 22:13
  • Do you want a comparison for each matching value? Like you want all the "7" classes compared, then all the 1318 classes compared? Or do you want to exclude rows that don't have matches, like 1223 appears in class1 but not in class2 so it should be omitted? Or do you want row-wise equality, so row 5 of your example would be included because classes 1 and 2 are both 7, but the other rows would all be skipped because they don't match? – Gregor Thomas Dec 27 '17 at 22:13
  • 1
    Also, please save the `rstudio` tag for questions specific to the code editor RStudio. For example, if you have R code that runs in the command line or the RGui, but doesn't work in RStudio. – Gregor Thomas Dec 27 '17 at 22:15
  • @Gregor I am trying to get all the "7" classes compared, then all the 1318 classes compared. – Sharkbait Dec 28 '17 at 13:38
  • @InfiniteFlashChess Yep I'm pretty aware of the Tukey test. That compares the means for all combinations of groups. As I said above, I'm trying to be a bit more specific than that. Thanks for the insight. – Sharkbait Dec 28 '17 at 13:40
  • Okay, gotchya. I'll have to look at this question again then. – InfiniteFlash Dec 28 '17 at 17:12

0 Answers0