How to visualize an ordinal variable predicting a continuous outcome?How to visualize (make plot) of regression output against categorical input variable?Regression for continuous dependent variable with independent ordinal variableplot predicted values from a cumulative link model (clm, ordinal)Ordinal vs. Continuous Variable and Appropriate Method for Testing Difference of GroupsR Mediate: How to interpret output with an ordinal outcome?continuous independent variable with three levels

Lost passport and visa, tried to reapply, got rejected twice. What are my next steps?

I transpose the source code, you transpose the input!

Garage door sticks on a bolt

Vilna Gaon's gematria for the number of kosher & non-kosher sukkot in Masechet Sukkah

What makes learning more difficult as we age?

How important is knowledge of trig identities for use in Calculus

Can I exile my opponent's Progenitus/True-Name Nemesis with Teferi, Hero of Dominaria's emblem?

Assembly of PCBs containing a mix of SMT and thru-hole parts?

Worlds with different mathematics and logic

If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to the Sun?

Calculate the Ultraradical

Windows 10 deletes lots of tiny files super slowly. Anything that can be done to speed it up?

Can an energy drink or chocolate before an exam be useful ? What sort of other edible goods be helpful?

Impossible violin chord, how to fix this?

Why isn't there armor to protect from spells in the Potterverse?

Duck, duck, gone!

Fix Ethernet 10/100 PoE cable with 7 out of 8 wires alive

Speed and Velocity in Russian

How do my husband and I get over our fear of having another difficult baby?

What are one's options when facing religious discrimination at the airport?

About non-FTL travel and realitivistic effect for a hard sci fi novel

How to unpickle a Result object returned by an IBMQ experiment?

Can RPi4 run simultaneously on dual band (WiFi 2.4GHz / 5GHz)?

How to prevent pickpocketing in busy bars?



How to visualize an ordinal variable predicting a continuous outcome?


How to visualize (make plot) of regression output against categorical input variable?Regression for continuous dependent variable with independent ordinal variableplot predicted values from a cumulative link model (clm, ordinal)Ordinal vs. Continuous Variable and Appropriate Method for Testing Difference of GroupsR Mediate: How to interpret output with an ordinal outcome?continuous independent variable with three levels






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


What is the best way to visualize the relationship between an ordinal predictor and a continuous outcome? So far I have this, but I feel like this is lacking...



enter image description here



The way I modeled it is I treated the ordinal predictor as interval instead of categorical. If this is not the best way to treat this type of data, I'd appreciate the feedback.










share|cite|improve this question









$endgroup$









  • 3




    $begingroup$
    1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
    $endgroup$
    – Glen_b
    11 hours ago


















1












$begingroup$


What is the best way to visualize the relationship between an ordinal predictor and a continuous outcome? So far I have this, but I feel like this is lacking...



enter image description here



The way I modeled it is I treated the ordinal predictor as interval instead of categorical. If this is not the best way to treat this type of data, I'd appreciate the feedback.










share|cite|improve this question









$endgroup$









  • 3




    $begingroup$
    1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
    $endgroup$
    – Glen_b
    11 hours ago














1












1








1


1



$begingroup$


What is the best way to visualize the relationship between an ordinal predictor and a continuous outcome? So far I have this, but I feel like this is lacking...



enter image description here



The way I modeled it is I treated the ordinal predictor as interval instead of categorical. If this is not the best way to treat this type of data, I'd appreciate the feedback.










share|cite|improve this question









$endgroup$




What is the best way to visualize the relationship between an ordinal predictor and a continuous outcome? So far I have this, but I feel like this is lacking...



enter image description here



The way I modeled it is I treated the ordinal predictor as interval instead of categorical. If this is not the best way to treat this type of data, I'd appreciate the feedback.







data-visualization ordinal-data






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked 12 hours ago









762762

376 bronze badges




376 bronze badges










  • 3




    $begingroup$
    1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
    $endgroup$
    – Glen_b
    11 hours ago













  • 3




    $begingroup$
    1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
    $endgroup$
    – Glen_b
    11 hours ago








3




3




$begingroup$
1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
$endgroup$
– Glen_b
11 hours ago





$begingroup$
1. Is there any particular reason to imagine the relationship would be linear? 2. Is there indeed any need to draw any kind of curve or line? Why not simply mark in the means (or any other suitable measure of location) in each category? 3. Can you say more about the continuous outcome? What kind of thing is it?
$endgroup$
– Glen_b
11 hours ago











4 Answers
4






active

oldest

votes


















2














$begingroup$

The problem with this is that there's no way of knowing how many dots are bunched up together. Two solutions I've seen:



Box plot



This would give you tighter box if data points are bunched up together.



https://nycdatascience.com/blog/student-works/machine-learning/kaggle-competition-house-pricing-in-ames-iowa/



Bubble chart



Not sure if this is the official name, but basically you put the vertical axis into bins. The size of the bubble is determined by how many observations fall into that bin.



enter image description here






share|cite|improve this answer









$endgroup$














  • $begingroup$
    How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
    $endgroup$
    – Pieter
    8 hours ago











  • $begingroup$
    @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
    $endgroup$
    – Art
    8 hours ago


















1














$begingroup$

To your scatterplot, I would add a large point indicating the mean Y-value at every unique X-value, and also do one or more of the following:



  1. Square-root (or cube-root) transform your Y-axis. Both these
    transformations can deal with zeroes, unlike log transformations.
    Cube roots can also deal with negative numbers.

  2. Make the points a bit transparent.

  3. Add a little jitter to the X-axis values if the previous steps are insufficient.

As Glen_b notes, there is insufficient information right now to note whether adding a linear regression line is meaningful.






share|cite|improve this answer











$endgroup$














  • $begingroup$
    Are there any zeros in the response?
    $endgroup$
    – Nick Cox
    11 hours ago










  • $begingroup$
    @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
    $endgroup$
    – mkt
    11 hours ago










  • $begingroup$
    Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
    $endgroup$
    – Nick Cox
    9 hours ago










  • $begingroup$
    @NickCox Agreed, but the question was about how to visualise, not how to model.
    $endgroup$
    – mkt
    9 hours ago






  • 1




    $begingroup$
    Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
    $endgroup$
    – Nick Cox
    9 hours ago


















1














$begingroup$

The plot you shown is pretty good. But I think you can improve the data-ink ratio (invented by Edward Tufte) even more by showing all the datapoints. You can do this by adding jitter to the x-axis.



Another improvement is to emphasise that the ordinal variable is categorical and not continuous. You can do this by using a different colour for the different levels.



As an example I have plotted the titanic dataset in R, using the passenger class as an ordinal variable and the passenger age as the continuous variable.



library(tidyverse)
library(ggplot2)
library(titanic)

df <- titanic_train %>% mutate(Class=factor(Pclass))

ggplot(df, aes(Class, Age, color=Class)) +
geom_jitter(height = 0) +
ggtitle("Titanic passenger age vs. class")


enter image description here






share|cite|improve this answer









$endgroup$






















    1














    $begingroup$

    You state that one variable is ordinal, then you decide to treat it as interval. Is that reasonable? There is no way for us to know, as you have not said what the ordinal variable actually is. If you do decide to keep it as ordinal, then what to do depends on your sample size. If N is very large then I like the box plot solution. If N is not so large, then I like jitter. There are other additions you can make to the scatterplot as well - I wrote a presentation about this using SAS, but I am sure it could be duplicated in R. (If that link does not work, Googling flom, scatterplots, enhancements should find it).



    But what if treating the variable as interval is not reasonable? You could come to this conclusion either substantively or by trying different codings and seeing how results change. In that case, I suggest trying optimal scaling. There is an R package optiscale that may help (I have not used this package).






    share|cite|improve this answer









    $endgroup$

















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "65"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f428445%2fhow-to-visualize-an-ordinal-variable-predicting-a-continuous-outcome%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      $begingroup$

      The problem with this is that there's no way of knowing how many dots are bunched up together. Two solutions I've seen:



      Box plot



      This would give you tighter box if data points are bunched up together.



      https://nycdatascience.com/blog/student-works/machine-learning/kaggle-competition-house-pricing-in-ames-iowa/



      Bubble chart



      Not sure if this is the official name, but basically you put the vertical axis into bins. The size of the bubble is determined by how many observations fall into that bin.



      enter image description here






      share|cite|improve this answer









      $endgroup$














      • $begingroup$
        How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
        $endgroup$
        – Pieter
        8 hours ago











      • $begingroup$
        @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
        $endgroup$
        – Art
        8 hours ago















      2














      $begingroup$

      The problem with this is that there's no way of knowing how many dots are bunched up together. Two solutions I've seen:



      Box plot



      This would give you tighter box if data points are bunched up together.



      https://nycdatascience.com/blog/student-works/machine-learning/kaggle-competition-house-pricing-in-ames-iowa/



      Bubble chart



      Not sure if this is the official name, but basically you put the vertical axis into bins. The size of the bubble is determined by how many observations fall into that bin.



      enter image description here






      share|cite|improve this answer









      $endgroup$














      • $begingroup$
        How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
        $endgroup$
        – Pieter
        8 hours ago











      • $begingroup$
        @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
        $endgroup$
        – Art
        8 hours ago













      2














      2










      2







      $begingroup$

      The problem with this is that there's no way of knowing how many dots are bunched up together. Two solutions I've seen:



      Box plot



      This would give you tighter box if data points are bunched up together.



      https://nycdatascience.com/blog/student-works/machine-learning/kaggle-competition-house-pricing-in-ames-iowa/



      Bubble chart



      Not sure if this is the official name, but basically you put the vertical axis into bins. The size of the bubble is determined by how many observations fall into that bin.



      enter image description here






      share|cite|improve this answer









      $endgroup$



      The problem with this is that there's no way of knowing how many dots are bunched up together. Two solutions I've seen:



      Box plot



      This would give you tighter box if data points are bunched up together.



      https://nycdatascience.com/blog/student-works/machine-learning/kaggle-competition-house-pricing-in-ames-iowa/



      Bubble chart



      Not sure if this is the official name, but basically you put the vertical axis into bins. The size of the bubble is determined by how many observations fall into that bin.



      enter image description here







      share|cite|improve this answer












      share|cite|improve this answer



      share|cite|improve this answer










      answered 11 hours ago









      ArtArt

      3251 silver badge7 bronze badges




      3251 silver badge7 bronze badges














      • $begingroup$
        How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
        $endgroup$
        – Pieter
        8 hours ago











      • $begingroup$
        @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
        $endgroup$
        – Art
        8 hours ago
















      • $begingroup$
        How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
        $endgroup$
        – Pieter
        8 hours ago











      • $begingroup$
        @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
        $endgroup$
        – Art
        8 hours ago















      $begingroup$
      How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
      $endgroup$
      – Pieter
      8 hours ago





      $begingroup$
      How does the bubble chart help to display the ordinal variable? Maybe you can change your example image to one with ordinal data.
      $endgroup$
      – Pieter
      8 hours ago













      $begingroup$
      @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
      $endgroup$
      – Art
      8 hours ago




      $begingroup$
      @Pieter Thanks for the suggestion but I couldn't find one... but you can see the variable on the x-axis are all integers (11, 12, 13, 14, ...) so that's one example of discrete data, and you can treat ordinal values as discrete data.
      $endgroup$
      – Art
      8 hours ago













      1














      $begingroup$

      To your scatterplot, I would add a large point indicating the mean Y-value at every unique X-value, and also do one or more of the following:



      1. Square-root (or cube-root) transform your Y-axis. Both these
        transformations can deal with zeroes, unlike log transformations.
        Cube roots can also deal with negative numbers.

      2. Make the points a bit transparent.

      3. Add a little jitter to the X-axis values if the previous steps are insufficient.

      As Glen_b notes, there is insufficient information right now to note whether adding a linear regression line is meaningful.






      share|cite|improve this answer











      $endgroup$














      • $begingroup$
        Are there any zeros in the response?
        $endgroup$
        – Nick Cox
        11 hours ago










      • $begingroup$
        @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
        $endgroup$
        – mkt
        11 hours ago










      • $begingroup$
        Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
        $endgroup$
        – Nick Cox
        9 hours ago










      • $begingroup$
        @NickCox Agreed, but the question was about how to visualise, not how to model.
        $endgroup$
        – mkt
        9 hours ago






      • 1




        $begingroup$
        Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
        $endgroup$
        – Nick Cox
        9 hours ago















      1














      $begingroup$

      To your scatterplot, I would add a large point indicating the mean Y-value at every unique X-value, and also do one or more of the following:



      1. Square-root (or cube-root) transform your Y-axis. Both these
        transformations can deal with zeroes, unlike log transformations.
        Cube roots can also deal with negative numbers.

      2. Make the points a bit transparent.

      3. Add a little jitter to the X-axis values if the previous steps are insufficient.

      As Glen_b notes, there is insufficient information right now to note whether adding a linear regression line is meaningful.






      share|cite|improve this answer











      $endgroup$














      • $begingroup$
        Are there any zeros in the response?
        $endgroup$
        – Nick Cox
        11 hours ago










      • $begingroup$
        @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
        $endgroup$
        – mkt
        11 hours ago










      • $begingroup$
        Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
        $endgroup$
        – Nick Cox
        9 hours ago










      • $begingroup$
        @NickCox Agreed, but the question was about how to visualise, not how to model.
        $endgroup$
        – mkt
        9 hours ago






      • 1




        $begingroup$
        Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
        $endgroup$
        – Nick Cox
        9 hours ago













      1














      1










      1







      $begingroup$

      To your scatterplot, I would add a large point indicating the mean Y-value at every unique X-value, and also do one or more of the following:



      1. Square-root (or cube-root) transform your Y-axis. Both these
        transformations can deal with zeroes, unlike log transformations.
        Cube roots can also deal with negative numbers.

      2. Make the points a bit transparent.

      3. Add a little jitter to the X-axis values if the previous steps are insufficient.

      As Glen_b notes, there is insufficient information right now to note whether adding a linear regression line is meaningful.






      share|cite|improve this answer











      $endgroup$



      To your scatterplot, I would add a large point indicating the mean Y-value at every unique X-value, and also do one or more of the following:



      1. Square-root (or cube-root) transform your Y-axis. Both these
        transformations can deal with zeroes, unlike log transformations.
        Cube roots can also deal with negative numbers.

      2. Make the points a bit transparent.

      3. Add a little jitter to the X-axis values if the previous steps are insufficient.

      As Glen_b notes, there is insufficient information right now to note whether adding a linear regression line is meaningful.







      share|cite|improve this answer














      share|cite|improve this answer



      share|cite|improve this answer








      edited 11 hours ago

























      answered 11 hours ago









      mktmkt

      7,4436 gold badges31 silver badges89 bronze badges




      7,4436 gold badges31 silver badges89 bronze badges














      • $begingroup$
        Are there any zeros in the response?
        $endgroup$
        – Nick Cox
        11 hours ago










      • $begingroup$
        @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
        $endgroup$
        – mkt
        11 hours ago










      • $begingroup$
        Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
        $endgroup$
        – Nick Cox
        9 hours ago










      • $begingroup$
        @NickCox Agreed, but the question was about how to visualise, not how to model.
        $endgroup$
        – mkt
        9 hours ago






      • 1




        $begingroup$
        Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
        $endgroup$
        – Nick Cox
        9 hours ago
















      • $begingroup$
        Are there any zeros in the response?
        $endgroup$
        – Nick Cox
        11 hours ago










      • $begingroup$
        @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
        $endgroup$
        – mkt
        11 hours ago










      • $begingroup$
        Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
        $endgroup$
        – Nick Cox
        9 hours ago










      • $begingroup$
        @NickCox Agreed, but the question was about how to visualise, not how to model.
        $endgroup$
        – mkt
        9 hours ago






      • 1




        $begingroup$
        Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
        $endgroup$
        – Nick Cox
        9 hours ago















      $begingroup$
      Are there any zeros in the response?
      $endgroup$
      – Nick Cox
      11 hours ago




      $begingroup$
      Are there any zeros in the response?
      $endgroup$
      – Nick Cox
      11 hours ago












      $begingroup$
      @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
      $endgroup$
      – mkt
      11 hours ago




      $begingroup$
      @NickCox Hard to say for sure. I squinted at it and it seemed like there might be. See X = 3, for example.
      $endgroup$
      – mkt
      11 hours ago












      $begingroup$
      Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
      $endgroup$
      – Nick Cox
      9 hours ago




      $begingroup$
      Question remains for OP, who should know. Incidentally I am a small fan of cube roots, used in Miles, Stokes, Vieli, Cox in Nature. We had to work hard to persuade reviewers that they were a good idea for a response that was variously positive and negative. But for the question here I would favour a Poisson model, which can work fine for non-negative continuous responses.
      $endgroup$
      – Nick Cox
      9 hours ago












      $begingroup$
      @NickCox Agreed, but the question was about how to visualise, not how to model.
      $endgroup$
      – mkt
      9 hours ago




      $begingroup$
      @NickCox Agreed, but the question was about how to visualise, not how to model.
      $endgroup$
      – mkt
      9 hours ago




      1




      1




      $begingroup$
      Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
      $endgroup$
      – Nick Cox
      9 hours ago




      $begingroup$
      Indeed. That was a comment not an answer. But a Poisson model would imply plotting on log scale with a secondary question on how to plot observed zeros.
      $endgroup$
      – Nick Cox
      9 hours ago











      1














      $begingroup$

      The plot you shown is pretty good. But I think you can improve the data-ink ratio (invented by Edward Tufte) even more by showing all the datapoints. You can do this by adding jitter to the x-axis.



      Another improvement is to emphasise that the ordinal variable is categorical and not continuous. You can do this by using a different colour for the different levels.



      As an example I have plotted the titanic dataset in R, using the passenger class as an ordinal variable and the passenger age as the continuous variable.



      library(tidyverse)
      library(ggplot2)
      library(titanic)

      df <- titanic_train %>% mutate(Class=factor(Pclass))

      ggplot(df, aes(Class, Age, color=Class)) +
      geom_jitter(height = 0) +
      ggtitle("Titanic passenger age vs. class")


      enter image description here






      share|cite|improve this answer









      $endgroup$



















        1














        $begingroup$

        The plot you shown is pretty good. But I think you can improve the data-ink ratio (invented by Edward Tufte) even more by showing all the datapoints. You can do this by adding jitter to the x-axis.



        Another improvement is to emphasise that the ordinal variable is categorical and not continuous. You can do this by using a different colour for the different levels.



        As an example I have plotted the titanic dataset in R, using the passenger class as an ordinal variable and the passenger age as the continuous variable.



        library(tidyverse)
        library(ggplot2)
        library(titanic)

        df <- titanic_train %>% mutate(Class=factor(Pclass))

        ggplot(df, aes(Class, Age, color=Class)) +
        geom_jitter(height = 0) +
        ggtitle("Titanic passenger age vs. class")


        enter image description here






        share|cite|improve this answer









        $endgroup$

















          1














          1










          1







          $begingroup$

          The plot you shown is pretty good. But I think you can improve the data-ink ratio (invented by Edward Tufte) even more by showing all the datapoints. You can do this by adding jitter to the x-axis.



          Another improvement is to emphasise that the ordinal variable is categorical and not continuous. You can do this by using a different colour for the different levels.



          As an example I have plotted the titanic dataset in R, using the passenger class as an ordinal variable and the passenger age as the continuous variable.



          library(tidyverse)
          library(ggplot2)
          library(titanic)

          df <- titanic_train %>% mutate(Class=factor(Pclass))

          ggplot(df, aes(Class, Age, color=Class)) +
          geom_jitter(height = 0) +
          ggtitle("Titanic passenger age vs. class")


          enter image description here






          share|cite|improve this answer









          $endgroup$



          The plot you shown is pretty good. But I think you can improve the data-ink ratio (invented by Edward Tufte) even more by showing all the datapoints. You can do this by adding jitter to the x-axis.



          Another improvement is to emphasise that the ordinal variable is categorical and not continuous. You can do this by using a different colour for the different levels.



          As an example I have plotted the titanic dataset in R, using the passenger class as an ordinal variable and the passenger age as the continuous variable.



          library(tidyverse)
          library(ggplot2)
          library(titanic)

          df <- titanic_train %>% mutate(Class=factor(Pclass))

          ggplot(df, aes(Class, Age, color=Class)) +
          geom_jitter(height = 0) +
          ggtitle("Titanic passenger age vs. class")


          enter image description here







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered 8 hours ago









          PieterPieter

          1,4776 silver badges19 bronze badges




          1,4776 silver badges19 bronze badges
























              1














              $begingroup$

              You state that one variable is ordinal, then you decide to treat it as interval. Is that reasonable? There is no way for us to know, as you have not said what the ordinal variable actually is. If you do decide to keep it as ordinal, then what to do depends on your sample size. If N is very large then I like the box plot solution. If N is not so large, then I like jitter. There are other additions you can make to the scatterplot as well - I wrote a presentation about this using SAS, but I am sure it could be duplicated in R. (If that link does not work, Googling flom, scatterplots, enhancements should find it).



              But what if treating the variable as interval is not reasonable? You could come to this conclusion either substantively or by trying different codings and seeing how results change. In that case, I suggest trying optimal scaling. There is an R package optiscale that may help (I have not used this package).






              share|cite|improve this answer









              $endgroup$



















                1














                $begingroup$

                You state that one variable is ordinal, then you decide to treat it as interval. Is that reasonable? There is no way for us to know, as you have not said what the ordinal variable actually is. If you do decide to keep it as ordinal, then what to do depends on your sample size. If N is very large then I like the box plot solution. If N is not so large, then I like jitter. There are other additions you can make to the scatterplot as well - I wrote a presentation about this using SAS, but I am sure it could be duplicated in R. (If that link does not work, Googling flom, scatterplots, enhancements should find it).



                But what if treating the variable as interval is not reasonable? You could come to this conclusion either substantively or by trying different codings and seeing how results change. In that case, I suggest trying optimal scaling. There is an R package optiscale that may help (I have not used this package).






                share|cite|improve this answer









                $endgroup$

















                  1














                  1










                  1







                  $begingroup$

                  You state that one variable is ordinal, then you decide to treat it as interval. Is that reasonable? There is no way for us to know, as you have not said what the ordinal variable actually is. If you do decide to keep it as ordinal, then what to do depends on your sample size. If N is very large then I like the box plot solution. If N is not so large, then I like jitter. There are other additions you can make to the scatterplot as well - I wrote a presentation about this using SAS, but I am sure it could be duplicated in R. (If that link does not work, Googling flom, scatterplots, enhancements should find it).



                  But what if treating the variable as interval is not reasonable? You could come to this conclusion either substantively or by trying different codings and seeing how results change. In that case, I suggest trying optimal scaling. There is an R package optiscale that may help (I have not used this package).






                  share|cite|improve this answer









                  $endgroup$



                  You state that one variable is ordinal, then you decide to treat it as interval. Is that reasonable? There is no way for us to know, as you have not said what the ordinal variable actually is. If you do decide to keep it as ordinal, then what to do depends on your sample size. If N is very large then I like the box plot solution. If N is not so large, then I like jitter. There are other additions you can make to the scatterplot as well - I wrote a presentation about this using SAS, but I am sure it could be duplicated in R. (If that link does not work, Googling flom, scatterplots, enhancements should find it).



                  But what if treating the variable as interval is not reasonable? You could come to this conclusion either substantively or by trying different codings and seeing how results change. In that case, I suggest trying optimal scaling. There is an R package optiscale that may help (I have not used this package).







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 8 hours ago









                  Peter FlomPeter Flom

                  80.7k13 gold badges117 silver badges228 bronze badges




                  80.7k13 gold badges117 silver badges228 bronze badges































                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Cross Validated!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f428445%2fhow-to-visualize-an-ordinal-variable-predicting-a-continuous-outcome%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes