Announcement

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

  • catplot alternatives?

    Hi all!

    I have worker level data which I have split into two groups: those that are motivated, and those that are not.

    I want to make a two tables for each category, one which looks at the workers' demographic composition, and the other at the workers' job characteristics.

    I found a great example in the Tazhitdinova (2022) paper on moonlighting, attached below. I tried using catplot, but that gives me more of a horizontal bar chart rather than what I'm looking for.

    Any tips on alternative routes?

    Thanks
    Click image for larger version

Name:	Screenshot 2025-02-17 at 20.40.48.png
Views:	1
Size:	103.0 KB
ID:	1772921


  • #2
    https://doi.org/10.1177/1536867X0800800208 has various ideas
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      catplot is from SSC. It can do bars or dots; horizontal or vertical displays;; stacked or unstacked bars; and so on.

      I agree with @Maarten Buis's suggestion, unsurprisingly if you look at his link. In addition, designplot is of some relevance.

      Code:
      SJ-14-4 gr0061  Design plots for graphical summary of a response given factors
              (help designplot if installed)  . . . . . . . . . . . . . .  N. J. Cox
              Q4/14   SJ 14(4):975--990
              produces a graphical summary of a numeric response variable
              given one or more factors
      The most recent update is documented at https://journals.sagepub.com/doi/pdf...6867X241297954

      Code:
      . net sj 24-4 gr0061_4
      
      -------------------------------------------------------------------------------------------------------------
      package gr0061_4 from http://www.stata-journal.com/software/sj24-4
      -------------------------------------------------------------------------------------------------------------
      
      TITLE
            SJ24-4 gr0061_4. Update: Design plots for graphical ...
      
      DESCRIPTION/AUTHOR(S)
            Update: Design plots for graphical summary of a
              response given factors
            by Nicholas J. Cox, Department of Geography,
                 Durham University, Durham, UK
            Support:  [email protected]
            After installation, type help designplot
            DOI:  10.1177/1536867X241297954
      
      INSTALLATION FILES                             (type net install gr0061_4)
            gr0061_4/designplot.ado
            gr0061_4/designplot.sthlp
      
      ANCILLARY FILES                                (type net get gr0061_4)
            gr0061_4/designplot_examples.do
      ---------------------------------------------------
      The design in #1 does not look quite so good once you notice that there isn't enough space to give details for the more unusual categories.

      Comment


      • #4
        The paper you cited probably draw plots by using Stata (Tazhitdinova, 2022). https://www.nber.org/system/files/wo...726/w27726.pdf

        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input float(demographic categoryv percent)
        1 1 45
        1 2 55
        2 1 18
        2 2 23
        2 3 34
        2 4 14
        2 5 11
        3 1 83
        3 2 17
        4 1 93
        4 2  7
        5 1 12
        5 2 74
        5 3 14
        6 1  8
        6 2 29
        6 3 29
        6 4 17
        6 5 17
        7 1 16
        7 2 22
        7 3 42
        7 4 20
        8 1  8
        8 2 20
        8 3 11
        8 4 25
        8 5 36
        9 1 40
        9 2 26
        9 3 22
        9 4  5
        9 5  6
        end
        label values demographic Demographic
        label def Demographic 1 "1. Gender", modify
        label def Demographic 2 "2. Age", modify
        label def Demographic 3 "3. Geo", modify
        label def Demographic 4 "4. Nationality", modify
        label def Demographic 5 "5. Education", modify
        label def Demographic 6 "6. Monthly Income", modify
        label def Demographic 7 "7. Wage at firm", modify
        label def Demographic 8 "8. Firm: size", modify
        label def Demographic 9 "9. N minijobs at firm", modify
        
        graph hbar percent, over(categoryv) over(demographic) nofill asyvars stack bar(1, color(eltblue)) bar(2, color(gold)) bar(3, color(ltblue)) bar(4, color(orange)) bar(5, color(olive_teal)) blabel(bar, position(inside)) ytitle("percent") legend(off)
        Click image for larger version

Name:	Graph.png
Views:	1
Size:	171.1 KB
ID:	1772990

        Last edited by Chen Samulsion; 18 Feb 2025, 08:10.

        Comment


        • #5
          Thanks all!

          Comment

          Working...
          X