Announcement

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

  • Creating a bar chart for a multivariate analysis

    Hi, I've produced a bar chart which shows the mean of one variable (intolerance) for two other variables (gender) and (having children or not) (see picture - not in english).
    However, this graph only shows the bivariate relationship between these variables. Is it possible to summarize with either a bar chart or another kind of graph this relationship with use of control variables (the multivariate relationship between my primary variables (intolerance, gender and having children or not with control for other variables). For example I would like to summarize this relationship with control for age. Is it possible to do so?

    The current chart is produced with the following code:
    Code:
    graph bar (mean) intolerance, over(børn) by(køn) scheme(s1mono) ytitle("Gennemsnitlig score for indvandreskepsis")
    Kind regards
    Click image for larger version

Name:	q1a.jpg
Views:	1
Size:	22.6 KB
ID:	1612281








  • #2
    First off, I'd recommend instead

    Code:
     
     graph dot (mean) intolerance, over(børn) by(køn) scheme(s1mono) exclude0 ytitle("Gennemsnitlig score for indvandreskepsis")
    as your means appear to be all close to 0.5 but presumably the interesting thing is how they differ, not that they are all some way from zero.

    You need some kind of model after which you can plot its results. It's hard to know what kind of model makes sense without more information. For example, if your outcome variable is a (0, 1) indicator, you might be best advised to think in terms of a logit model.

    Comment


    • #3
      Thank you, I did want to illustrate how they differ, so this makes more sense.
      Click image for larger version

Name:	q2.jpg
Views:	1
Size:	21.8 KB
ID:	1612289


      How can I plot my results given that I'm using a linear model with my outcome variable being metric (0-10) and my independent variable as well as my interaction variable (gender and parenthood) are dummy variables?

      Comment


      • #4
        I misread your graphs — no good reason for that — but with a bounded outcome after scaling logit might still be competitive with a regression model. It seems likely that the commands margins and margins plot are what you seek.

        Comment


        • #5
          I've already created a marginsplot using the following code:
          Code:
          xtset essround
          xtreg c.intolerance i.børn##i.køn i.indkomst c.eduyrs c.agea i.cntry2, robust fe
          margins, dydx(børn) over (køn)
          marginsplot, recast(scatter) yline(0) xscale(range(-0.5 1.5)) xtitle("Køn") ytitle ("Marginal effekt af forældreskab") title("Marginal effekt af forældreskab på indvandreskepsis ved 95%-konfidensinterval") scheme(s1mono)
          And although this gives a good understanding of the differences of effect controlling for relevant variables like age, I'd like to illustrate what this effect essentially translates to overall (for example by something similar to a bar chart controlling for relevant variables)
          Click image for larger version

Name:	w2.jpg
Views:	1
Size:	17.5 KB
ID:	1612296

          Comment


          • #6
            Sorry, but I don't follow what different thing you want here.

            Comment


            • #7
              I think perhaps a coefplot is what I'm after which I'll try to produce

              Comment

              Working...
              X