We would like to explain a continuous variable Y in terms of X1,X2,X3,X4,X5
(continuous grades from 0/20 to 20/20).
When plotting Y
vs. X1
, I would like to color the points in terms of the means (X1+X2+X3+X4+X5)/5
to see if the candidates that are bad in X1
are globally bad.
So, mean
, varying from 0 to 20, would be blood red and gradually going to bright green for the ones having (and also indicate this in a legend). How could one proceed this?
Here is how I usually draw my scatter plots:
scatter.smooth(x=data$X1, y=data$Y1, main="Y1 ~ X1", xlab="X1", ylab="Y1")
Even better would be that each point is colored in terms of its X1 value, and has a colored "ring" around it corresponding to the color of its mean.