I am trying to run a ANOVA with the model
LOS = HR + RESP + TEMP + SpO2
All 5 variables are discrete numerical values(all integers).
Initially, I got a Shapiro Wilks of p-value < 2.2e-16 with no transformation. The Q-Q plot shows that there is an obvious need for a transformation.
Using a log transformation I still did not achieve normality(p-value = 1.193e-12). Althought the Q-Q plots look much better
After this I am trying to a Box-Cox transformation to the initial LOS(response variable) and got a Shapiro - Wilk(p-value = 6.792e-10
m.full <- lm(LOS ~ NEWS, data2)
bc.full <- boxcox(m.full); bc.full.opt <- bc.full$x[which.max(bc.full$y)]
data2$LOS.bc <- bcPower(data2$LOS, bc.full.opt)
print(qplot(data=data2, x=NEWS, y=LOS.bc, geom="boxplot"))
m.bc_full.null <- lm(LOS.bc ~ 1, data=data2)
m.bc_full.full <- lm(LOS.bc ~ NEWS, data=data2)
print(anova(m.bc_full.null, m.bc_full.full))
Am I implementing the Box-Cox transformation incorrectly or is there anything I could be doing better?