When studying the relationship between 2 quantitative variables, it is sometimes better to divide x in several groups.
Is is really easy to do it with the cut function that divides the range of
x into intervals and codes the values in
x according to which interval they fall !
# Create 2 quantitative variables
# Transform the variable 1 as a qualitative
variable1_cut = cut(variable1, breaks=seq(from=0, to=ceiling(max(variable1)), by=250))
# Make a classical boxplot
boxplot(variable2 ~ variable1_cut , col=terrain.colors(4) )
Not what you are looking for ? Make a new search !