I have three factors,

  1. Income(from source A),continuous variable
  2. Income(from source B), continuous variable
  3. Happiness index,continuous variable

Suppose I have 500 samples. My goal is to show the influence of both Income(from source A) and Income(from source B) on Happiness index. Meanwhile, I want to show the distribution of Happiness index. I think a boxplot on Happiness index is a good choice. I can use color to represent Income(from source A), however, how can I represent another continuous variable, i.e, Income(from source B) here?

  • $\begingroup$ What does outcome variable represent? $\endgroup$ Aug 3 '20 at 4:38
  • $\begingroup$ @prashant0598 Thank you for pointing out my mistakes. I have updated my question. $\endgroup$
    – Jie
    Aug 3 '20 at 5:27

What you can do is discretize happiness index using cut() and assign labels to it.

For plotting then you can use groupby boxplot which will show effect of both income sources on a particular happiness index bin.

Refer GroupbyBoxplot

If you want distribution of happiness index then you can try:

Color Scales

  • $\begingroup$ I need to show the distribution of happiness index, so to discretize the happiness index is not a good solution. Maybe to discretize income variables is better. $\endgroup$
    – Jie
    Aug 3 '20 at 6:20
  • $\begingroup$ It all depends on your requirements. Discretizing income variables is not a good idea as income value can be different for both source so would be the criteria for income to be called high. Hence the plot would not be that intuitive. $\endgroup$ Aug 3 '20 at 6:49
  • $\begingroup$ Thanks. I'm trying Parallel coordinates chart now. $\endgroup$
    – Jie
    Aug 3 '20 at 6:53
  • $\begingroup$ If you don't want a box plot but only distribution then you can look at the updated answer. Hope it helps :) $\endgroup$ Aug 3 '20 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.