Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bar graph with categorical variables

    Dear all, I am struggling with an easy way to represent the distribution of responses of a set of categorical variables with three response categories. I tried both bar graph and catplot, but I did not find the proper way to create the graph I have in mind, which basically should be like something an horizontal stack bar graph with the percentage of response for each category in each variable.

    Here the data I am working with.


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(job_sat_tre job_sat_inter_tre job_sat_wage_tre job_sat_career_tre job_sat_stabi_tre job_sat_rel_tre job_sat_nhours_tre job_sat_dista_tre)
    1 1 3 1 3 1 3 1
    3 3 2 2 3 3 3 3
    3 3 3 3 3 3 3 3
    2 2 2 2 2 2 2 2
    3 3 2 3 3 3 3 3
    end
    Thanks a lot, best, ciao, Giorgio

  • #2
    You have 8 variables there. all job_sat_ followed by

    Code:
    tre         inter_tre   wage_tre    career_tre  stabi_tre   rel_tre     nhours_tre  dista_tre
    I guess that you'll need a different structure to get what you want, but I think you will need to explain much more about what you do want.

    Comment


    • #3
      Dear Nick, sorry for the delay in my response.

      I created the variables *_tre* from the original ones, ranging from 1 to 10. My idea was to create 3 cut-off along the 1-10 range to show the distribution of scores within these 3 cut-off (the 3 categories of the *_tre* variables).

      Sorry if I am not totally clear, does additional pieces of information make clearer the picture?

      Thanks a lot, best, Giorgio

      Comment

      Working...
      X