Hi,
I am trying to find something which is very common in other statistical packages like SPSS.
I trying to highlight all means scores in one subgroup which are significantly different to another subgroup.
I have this simple df:
source <- data.frame(
stringsAsFactors = FALSE,
URN = c("bbb","ccc","hhh",
"aaa","ddd","eee","fff","ggg","iii"),
QF16 = c("No","No","No",
"No","Yes","Yes","Yes","Yes","Yes"),
QF70_Top2 = c(50, 50, 0, 100, 0, 100, 100, 100, 100),
Q12_Top2 = c(0, 0, 0, NA, 100, 100, 0, 100, NA),
QF2_Top2 = c(0, 0, 0, 100, 100, 0, 100, 100, 100),
QF4 = c(100, 100, 0, 100, 100, 100, 100, 100, 100)
)
source
and I need output similar to this:
In the above you have a table with means of all questions including (Top2).
The second table in empty but if Average of QF70_Top2 for QF16=Yes was significantly higher than Average of QF70_Top2 for QF16=No that I would see A in the first row of the second column like this example based on a different data:
In the example above, value 1 (B) in question QG1 is significantly higher than value 0 (A) and value 2 (C).
Is it possible to do something like this in R (for variables containing Top2 in their name)?