I am trying to compare readings from an old flowmeter and a new digital flowmeter to find out if they are significantly different. With the new meter I did readings under different conditions eg. calibrated at 30 seconds, calibrated at 60 seconds, uncalibrated at 30 seconds and uncalibrated at 60 seconds. I want to compare my old flowmeter (first column on dataset) to the other readings (columns 2:5 on dataset). I used anova to compare the groups and found some differences but I am stuck with TukeyHSD...My question is: Is this the correct way to do the comparisons...I would appreciate some advice on how to accomplish this task...Here is my dataset and code....
meter <- structure(list(SiteNumber = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L), .Label = c("site1",
"site2", "site3", "site4"), class = "factor"), old_dev = c(2.09,
1.927, 2.11, 2.114, 2.11, 1.995, 2.605, 2.563, 2.393, 2.286,
2.529, 2.371, 2.214, 2.128, 2.302, 2.204, 2.274, 3.513, 2.61,
3.502, 3.155, 3.131, 3.55, 3.656, 3.666, 3.618, 3.023, 3.226,
3.649, 3.519, 3.322, 3.352, 3.323, 3.144, 2.869, 3.383, 3.076,
2.978, 3.189, 2.934, 2.813, 3.015, 3.014, 3.056, 2.952, 2.988,
2.976, 3.049, 2.869, 2.965, 2.895, 2.064, 1.333, 1.432, 1.599,
1.52, 1.51, 2.734, 2.182, 2.71, 2.488, 2.242, 1.998, 1.175, 1.791,
2.152, 3.414, 3.278), new_dev_unc30 = c(2.6, 2.6, 2.7, 2.6, 2.3,
2.6, 3.2, 2.9, 2.1, 2.8, 1.8, 2.6, 2.5, 1.4, 2.7, 2.6, 2.2, 4.1,
3.4, 3.7, 4, 4, 4.5, 4.5, 1.7,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3, 3.2, 3.3, 3.4, 2.1, 3.4, 2.5, 3.8, 3.8, 3.9, 3.6, 3.5, 2.4,
2.9, 3.1, 2.3, 2.6, 3.1, 2.2, 0.8, 3.2, 2.6, 3.1, 0.9, 1.7, 1.2,
1.5, 1.2, 1, 1.1, 2.6, 1.6, 1.9, 0.6, 2.3, 1.4, 1.2, 1.5, 1.2,
1.4, 1.4)), .Names = c("SiteNumber", "old_dev", "new_dev_unc30",
"new_dev_unc60", "new_dev_cal30", "new_dev_cal60"), class = "data.frame", row.names = c(NA,
-68L))
Here is what I did:
str(meter)
attach(meter)
boxplot(list(old_dev,new_dev_unc30,new_dev_unc60,new_dev_cal30,new_dev_cal60))
summary(firsttest <- aov(old_dev ~ new_dev_unc30 + new_dev_unc60 + new_dev_cal30 + new_dev_cal60 ))
plot(firsttest)
TukeyHSD(??????)
summary(test1 <- aov(old_dev ~ new_dev_unc30)); summary(test2 <- aov(old_dev ~new_dev_unc60)); summary(test3 <- aov(old_dev ~ new_dev_cal30)); summary(test4 <- aov(old_dev ~ new_dev_cal60))
to compare the old device with the different modes of the new one? $\endgroup$ – user9093 Feb 9 '12 at 22:50aov
is alwaysdependent.variable ~ independent.variable
whereindependent.variable
needs to be a nominal factor (see?factor
). And please edit your question and do not post questions as answers. $\endgroup$ – Henrik Feb 10 '12 at 9:59