Announcement

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

  • Sorting data for graph with asyvars

    Hello all,

    My data is below

    [CODE]
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str33 Skill str26 SkillsGroup double C
    "Reading Comprehension"             "Basic Skills "              .574
    "Active Listening"                  "Basic Skills "              .542
    "Writing"                           "Basic Skills "              .521
    "Speaking"                          "Basic Skills "              .537
    "Mathematics Skills"                "Basic Skills "              .275
    "Science"                           "Basic Skills "              .116
    "Critical Thinking"                 "Basic Skills "              .534
    "Active Learning"                   "Basic Skills "              .509
    "Learning Strategies"               "Basic Skills "              .494
    "Monitoring"                        "Basic Skills "              .554
    "Social Perceptiveness"             "Social Skills"              .455
    "Coordination"                      "Social Skills"              .465
    "Persuasion"                        "Social Skills"              .343
    "Negotiation"                       "Social Skills"               .34
    "Instructing"                       "Social Skills"              .456
    "Service Orientation"               "Social Skills"              .316
    "Complex Problem Solving"           "Complex Problem Solving"    .452
    "Operations Analysis"               "Technical Skills"           .236
    "Technology Design"                 "Technical Skills"            .07
    "Equipment Selection"               "Technical Skills"           .043
    "Installation"                      "Technical Skills"           .039
    "Programming"                       "Technical Skills"           .053
    "Operation Monitoring"              "Technical Skills"           .188
    "Operation and Control"             "Technical Skills"           .083
    "Equipment Maintenance"             "Technical Skills"           .039
    "Troubleshooting"                   "Technical Skills"            .11
    "Repairing"                         "Technical Skills"           .049
    "Quality Control Analysis"          "Technical Skills"           .145
    "Judgement and Decision Making"     "Systems Skills"             .474
    "Systems Analysis"                  "Systems Skills"             .383
    "Systems Evaluation"                "Systems Skills"             .393
    "Time Management"                   "Resource Management Skills" .415
    "Management of Financial Resources" "Resource Management Skills"  .25
    "Management of Material Resources"  "Resource Management Skills" .183
    "Management of Personnel Resources" "Resource Management Skills" .414
    end
    When I do the following:

    Code:
    graph hbar C, over(Skill, sort(1) descending)
    I get the following

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	129.0 KB
ID:	1526438





    which is what I'd like, except I want to highlight the skills groups that each individual skill belongs to.

    So I tried the following:

    Code:
    graph hbar C, over(SkillsGroup) asyvars over(Skill, sort(1) descending)
    However this organises the graph in an odd way (see below).

    Click image for larger version

Name:	Graph_2.png
Views:	1
Size:	139.5 KB
ID:	1526439

    Last edited by Chris Rooney; 26 Nov 2019, 02:50.

  • #2
    Here are some freely available Stata Journal articles (by Nick Cox) that can help

    https://www.stata-journal.com/articl...article=gr0049

    https://www.stata-journal.com/articl...article=gr0034
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Originally posted by Maarten Buis View Post
      Here are some freely available Stata Journal articles (by Nick Cox) that can help

      https://www.stata-journal.com/articl...article=gr0049

      https://www.stata-journal.com/articl...article=gr0034
      Thanks, will have a look!

      Comment


      • #4
        The nofill option may help. I played a bit with your data and was hard pressed to find any good solutions. Shorter and less repetitive category text would help.

        Comment

        Working...
        X