Announcement

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

  • Graphic for different variables with the same scale

    Hello everyone,

    I am currently writing my master's thesis and I have a little question concerning the graphics. I have 9 different variables (characterizingthe work place - for example flat hierarchy, innovative, digital and so on) with the same scale (1 "totally disagree" to 5"totally agree") and I would like to show all of them in one bar chart, so that the y axis shows the different items and x axis shows the scale. I can't find a command that is doing this and I'm not sure which graphic could be nice to show the results. I would be really happy for any suggestions!

    Best regards, Julia
    Last edited by Julia Katharina; 30 May 2018, 08:29.

  • #2
    See recent posts in https://www.statalist.org/forums/for...raphs-combined

    Comment


    • #3
      I found a solution:

      *1. Syntax gilt für rauskopierte Variablenblöcke in eigenen Datensatz

      *a) Umstrukturierung der Daten --> "f" steht für alle Variablen eines Blocks

      gen id = _n
      reshape long f, i(id) j(id)

      *b) Umbenennung der Variable fŸr die Frage-Nr. und der Antwortkategorien (welche immer gleich sind)

      label variable _j "Frage-Nr."
      rename _j frage

      label variable f "Antwort"
      rename f antwort

      *c) Erstellen der Labels für die Fragen

      label define fragelabels2 1 "Flache Hierarchie" 2 "Innovativ" 3 "gutes Betriebsklima" //
      4 "kompetenzfördernd" 5 "modern" 6 "offen" 7 "transparent" 8 "digital" 9 "partizipativ"

      label values frage fragelabels2


      *d) Erstellen der jeweiligen gestapelten Säulendiagramme pro Block: generieren der Zählvariablen

      tab antwort ,g(zahl) nof


      graph bar zahl*, over(frage, label(angle(45))) percentages stack legend(rows(2) position(6)) legend(label(1 "trifft überhaupt nicht zu") label(2 "trifft eher nicht zu") ///
      label(3 "weder noch") label(4 "trifft eher zu") label(5 "trifft voll und ganz zu")) ///
      bar (1, bcolor(orange)) bar (2, bcolor(blue)) bar (3, bcolor(purple)) bar (4, bcolor(green)) bar (5, bcolor(red)) bar (6, bcolor(olive_teal)) ///
      blabel(bar, position(center) format(%4,2f)) ///
      ytitle ("Prozent") ///
      title ("Charakterisierung des Arbeitsumfelds", size (medium))

      Comment

      Working...
      X