Announcement

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

  • Graph Dot with Multiple Labels

    Hi. I'm struggling to produce a dot chart that displays a numeric value (autoindex) associated with each occupational code (soc2), columned by occupational cluster areas in the data (cluster2), colored by education level (edlevel2). Essentially, I am wanting to produce a static dot graph similar to the one at the top of this page

    https://careerexplorer.hawaii.edu/automation/ai.php

    except, I would like the dots to be colored according to education level.

    Any suggestions? I'm not getting very far with graph dot. Many thanks in advance.


    *sample 2
    *dataex soc2 jobtitle edlevel2 cluster2 autoindex, var
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long soc2 str112 jobtitle float edlevel2 long cluster2 double autoindex
    442 "Proofreaders and copy markers"                                                   3  3    95
    223 "Media and communication workers, all other"                                      1  3  92.8
    452 "Agricultural workers, all other"                                                 1  1 107.7
    536 "Bicycle repairers"                                                               1 16 114.7
    333 "First-line supervisors of landscaping, lawn service, and groundskeeping workers" 1  2 101.3
    537 "Recreational vehicle service technicians"                                        1 16 110.9
    491 "Helpers--electricians"                                                           1  2 134.7
    555 "Wind turbine service technicians"                                                2 13 106.3
    524 "Security and fire alarm systems installers"                                      1 13 113.2
     33 "Claims adjusters, examiners, and investigators"                                  1  6  89.4
    453 "Forest and conservation workers"                                                 1  1   111
    390 "Sales and related workers, all other"                                            1 14  96.9
     92 "Architectural and civil drafters"                                                2  2  88.9
    289 "Medical equipment preparers"                                                     1  8 110.1
    end
    label values soc2 soc2
    label def soc2 33 "13-1031", modify
    label def soc2 92 "17-3011", modify
    label def soc2 223 "27-3099", modify
    label def soc2 289 "31-9093", modify
    label def soc2 333 "37-1012", modify
    label def soc2 390 "41-9099", modify
    label def soc2 442 "43-9081", modify
    label def soc2 452 "45-2099", modify
    label def soc2 453 "45-4011", modify
    label def soc2 491 "47-3013", modify
    label def soc2 524 "49-2098", modify
    label def soc2 536 "49-3091", modify
    label def soc2 537 "49-3092", modify
    label def soc2 555 "49-9081", modify
    label values edlevel2 edlevel
    label def edlevel 1 "High School or Less", modify
    label def edlevel 2 "Associate's & Some College", modify
    label def edlevel 3 "Bachelor's and Above", modify
    label values cluster2 cluster2
    label def cluster2 1 "Agriculture, Food & Natural Resources", modify
    label def cluster2 2 "Architecture & Construction", modify
    label def cluster2 3 "Arts, Audio/Video Technology & Communications", modify
    label def cluster2 6 "Finance", modify
    label def cluster2 8 "Health Science", modify
    label def cluster2 13 "Manufacturing", modify
    label def cluster2 14 "Marketing", modify
    label def cluster2 16 "Transportation, Distribution & Logistics", modify
    label var soc2 "SOC Code" 
    label var jobtitle "Job Title" 
    label var edlevel2 "Education Level" 
    label var cluster2 "Career Cluster" 
    label var autoindex "Automation Index"





  • #2
    Thanks for the data example. I got one graph I liked and several I didn't like so much out of some play.

    Code:
    set scheme s1color 
    
    graph dot (asis) autoindex if soc != 333, over(jobtitle, sort(1) descending) exclude0 ysc(alt r(85 .)) linetype(line) lines(lw(thin) lc(gs12)) blabel(bar, format(%3.0f))
    Some negative and positive points:

    1. Your job titles are uncomfortably long for this purpose. I left out the longest as a signal.

    2. For graphs with table flavour I like to put the y axis stuff at the top. That's a matter of taste.

    3. Showing numbers too might well seem overkill. The display format is also at choice.

    4. If 100 is some special level, consider adding a grid line.

    Click image for larger version

Name:	automation.png
Views:	1
Size:	39.8 KB
ID:	1706671


    Here is the code for a second graph any way:

    Code:
    separate autoindex, by(edlevel2) veryshortlabel 
    
    graph dot (asis) autoindex? if soc != 333, over(jobtitle, sort(autoindex) descending) exclude0 ysc(alt r(85 .)) nofill linetype(line) lines(lw(thin) lc(gs12)) blabel(bar, format(%3.0f)) name(DOT2, replace) legend(col(1)) marker(1, ms(Oh)) marker(2, ms(Dh)) marker(3, ms(X)) ytitle(Automation Index)

    Comment

    Working...
    X