Announcement

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

  • marginsplot

    Dear Statalist
    I have successfully used the new gsem latent class analysis command in Stata15 however when I use margins and marginsplot to visually compare the probabilities across classes I get a single plot line rather than a bar graph depicting the probabilities of the categorical variables in the model within each of the three latent classes. I followed the commands in the example provided by Stata at https://www.stata.com/new-in-stata/l...lass-analysis/
    Any help would be greatly appreciated.
    BW
    Paul



  • #2
    They don't give the marginsplot command and I doubt it was just "marginsplot". Note the options for recasting the plot type and plotting with a by variable are available in marginsplot.

    Comment


    • #3
      Hi Dave
      many thanks. Already tried recast (bar) but not sure on command to obtain by var. Will keep trying.

      Comment


      • #4
        bydimension(dimlist [, dimopts])

        There is an example using this option.

        Comment


        • #5
          Hi Dave
          where can I find the example?
          Paul

          Comment


          • #6
            In the help for marginsplot there are a few examples one of which is:


            Setup
            . webuse nhanes2

            Controlling dimensions
            . regress bpsystol agegrp##sex##c.bmi
            . margins agegrp, over(sex) at(bmi=(10(10)60))
            . marginsplot
            . marginsplot, xdimension(agegrp)
            . marginsplot, xdimension(agegrp) bydimension(sex)
            . marginsplot, xdimension(agegrp) bydimension(bmi) xlabel(, angle(45))

            I'm using version 14.2.

            Comment


            • #7
              Hi Dave
              many thanks.
              Paul

              Comment

              Working...
              X