Announcement

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

  • Lasagne plot in Stata ?

    Hi,
    I have just been reading about lasagne plots (Jones, 2014). Is there any similar type of plotting program in Stata ?
    Regards,
    Andrea Burgess

  • #2
    Jones 2014 is presumably an interesting paper but your optimism that readers will recognise the reference is extraordinary. (Alternatively,any implication that it's our job to find out what it is will not make your question more attractive.)

    Please note our advice specifically against (name, date) references in the FAQ Advice that every new topic prompt reminds you about. http://www.statalist.org/forums/help#references

    Comment


    • #3

      Sorry, the article is

      Jones M, Hockey R, Mishra G and Dobson A. Visualising and modelling changes in categorical variables in longitudinal studies. BMC Medical Resarch Methodology 2014, 14:32

      Comment


      • #4
        Also, the http is

        http://www.biomedcentral.com/1471-2288/14/32

        Comment


        • #5
          Thanks for the reference (which minimally would be Jones et al. 2014). Some people may be able to access http://download.springer.com/static/...2288-14-32.pdf

          Comment


          • #6
            I wonder whether a - graph bar - with the option - stack - wouldn't apply to Andrea"s needs.

            Best regards,

            Marcos

            Comment


            • #7
              Nick, the link you gave in #5 doesn't work (but the one in #4 does).

              To answer the initial question: Andrea, could you give us (using SSC) some illustrational purposes data, that fit for such graphs? I'd like to try using graph bar command with the stack option, but not sure you can achieve the same "Lasagne" result, (actually I am pretty pesimist about that, or it would at least require intermediate steps modifying the data and generating new variables, but this is only a ex-ante feeling, and I can't conclude anything before testing on real data).

              Also you could take a look to:
              http://www.stata.com/support/faqs/gr...ked-bar-chart/

              And
              http://www.stata.com/manuals13/g-2graphbar.pdf
              Last edited by Charlie Joyez; 16 Jan 2017, 07:23. Reason: Marcos replied first and gave the essential point of my post.

              Comment


              • #8
                The original categorical variables are macs (5 categories describing manual ability) and mtype1 (6 categories describing type of motor impairment ). Appt_type describes the time at which children were seen (between 1 to 6 time points for each child). ctime was generated for use with modelling.
                I generated a new variable UCPandBCP (3 categories) to use instead of mtype1 in order to condense the number of categories. Then I also generated new variables to separate out the three categories UCP_new BCP_new other_new in my attempts to do graph bars.

                I was wondering is if there was a way to visually show the mean change in macs over time for each of the UCPandBCP categories ?

                I have looked at the stacked graph bars, and had a go, but couldn't get it to work.
                If it is too much trouble, or not possible, please don't bother.

                Regards,
                Andrea.



                ----------------------- copy starting from the next line -----------------------
                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input int patientid byte appt_type int(mtype1 macs UCPandBCP) float(ctime UCP_new BCP_new other_new)
                1387 18 . . . 17 0 0 0
                1387 24 2 1 2 23 0 1 0
                1387 30 2 1 2 29 0 1 0
                1387 36 2 2 2 35 0 1 0
                1387 48 2 1 2 47 0 1 0
                1387 60 1 1 1 59 1 0 0
                1391 18 . . . 17 0 0 0
                1391 24 2 2 2 23 0 1 0
                1391 30 2 2 2 29 0 1 0
                1391 36 2 2 2 35 0 1 0
                end
                label values appt_type appt_type_labels
                label def appt_type_labels 18 "18 months", modify
                label def appt_type_labels 24 "24 months", modify
                label def appt_type_labels 30 "30 months", modify
                label def appt_type_labels 36 "36 months", modify
                label def appt_type_labels 48 "48 months", modify
                label def appt_type_labels 60 "60 months", modify
                label values mtype1 mtype1_labels3
                label def mtype1_labels3 1 "unilateral spastic", modify
                label def mtype1_labels3 2 "bilateral spastic", modify
                label values macs macs_labels
                label def macs_labels 1 "MACS 1", modify
                label def macs_labels 2 "MACS 2", modify
                ------------------ copy up to and including the previous line ------------------



                Comment


                • #9
                  The question needs to be slighlty reworded....

                  I was wondering is if there was a way to visually show change in the mean of macs over time for each of the UCPandBCP categories ?

                  eg. see the mean MACS for UCP_new BCP_new other_new at each time point.

                  Comment


                  • #10
                    Hello Andrea,

                    I wonder whether one of the examples here (http://statadaily.com/2010/09/15/stacked-bar/) wouldn't fit your needs. In short, as already commented, you'd need to use the - stack - option for the - graph bar - commands.

                    Best,

                    Marcos
                    Best regards,

                    Marcos

                    Comment


                    • #11
                      As I understand it macs is a variable taking on values 1 and 2, so its mean over time would have a value in between. When wanting to plot its mean over time do you mean what you say or are you really interested in the varying proportions of two types?

                      Comment


                      • #12
                        Sorry for delay in writing back.
                        Macs can take on values 1 to 5 and mtype can take on values 1 to 6.

                        I did originally want a plot which showed changes in distribution, or varying proportions at each time interval.
                        For example, a subject who has a diagnosis of mtype 1 and is classified as macs 1 at the first time point , may deteriorate and be classified as macs 2 to at the third time point.

                        I got confused about the means.

                        Comment


                        • #13
                          As I understand it you have a three-way table, mtype by macs by time. So, you can show frequencies or percents (proportions, fractions) using graph bar, graph dot or tabplot (SJ), and that's not an exclusive list.

                          Comment


                          • #14
                            Thank you. I was overthinking it.
                            I have borrowed the book Speaking Stata Graphics.

                            Comment


                            • #15
                              That doesn't cover tabplot comprehensively but the help file is quite detailed.

                              Comment

                              Working...
                              X