My Y variable is binary and takes the values 0 and 1. The same applies for the independent variable X. I've been able to create the means within the group, here:
If Y = 0 -> X = .51
If Y = 1 -> X = .69
What I want to know is, whether 0.51 and 0.69 are that much different from each other. In other words, do people with illness (Y) really die (X) on average more than people without illness. I'm not sure, whether to use ANOVA or a pairwise t-test.
My approach is
t.test(data$Y, data$X, data = data, paired = TRUE)
and the other approach is
pairwise.t.test(data$Y, data$X, p.adjust = "bonferroni")
Am I on the right track?