# about discrete and continuous variables relationships exploration

I have a dataset with a dependent variable that is discrete. It can take only six values. The input variables are all continuous. I am using R to do data exploration. I am using boxplot(discrete vs continuous) instead of scatter plot which looks strange. 1. I am using corr command to get the correlation value. My primary question is with regards to the correlation coefficients I get from R. Most of the literature states the Pearson coefficient is only for continuous variables. But I don't see why I can't use to see the "relation" between discrete and continuous variables? Or are there other coefficients I could use? I am fairly new at this any literature reference would be great.

have a dataset with a dependent variable that is discrete. It can take only six values.

You need to specify the problem a bit further. The discrete variable is either ordinal (meaning that there is a meaning to the order of the discrete values) or categorical/nominal (meaning that the values are just encodings to integers, but the order between these integers has no inherent meaning).

If the discrete value is ordinal, you can use - for each independent variable and the dependent variable - Spearman's test (R implementation) which is a non-parametric test which cares not about the distributions, and so ordinal is fine for it. As Nick Cox points out below, if the value is ordinal, it might even be proportional, e.g., as when it is the numerator of a fraction, in which case you can do even better than a non-parametric test.

If the discrete variable is categorical, you can use - for each independent variable and the dependent variable - Kruskal-Wallis non-parametric one-way ANOVA (R implementation). If the test shows significance, you can proceed with Dunn's test (R implementation) to see what exactly it is.

• Thanks for the response. It is the result of "service survey". So, it starts at 0(bad), 1(not bad), 2(ok), etc. I only have the numerical values. Yes, there is meaning to the order because the small values are indication of bad service and high value is excellent service. Mar 24, 2018 at 22:16
• @Josef So then it's ordinal, and a Spearman's will do the job. Mar 24, 2018 at 22:31
• In principle you could have counted fractions as well as ordinal or nominal variables with just 6 distinct values (or any other number). Say students take 5 exams and pass or fail each, so the possible number of passes is a a count, or equivalently a fraction, 0/5, 1/5, ..., 5/5. That measurement scale is more than ordinal as differences and ratios all make sense. (X passed one more exam than Y; U passed twice as many exams as V.) So, there are more flavours to discrete than those you mentioned. It turns out that the OP's example is not of this form, but such variables are common. Mar 25, 2018 at 9:41
• (ctd) Binomial distributions are the simplest reference distribution for such variables. Mar 25, 2018 at 9:42
• @NickCox That is an excellent point, thanks! I'll update the answer. Mar 25, 2018 at 10:45