Announcement

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

  • Visualizing longitudinal data

    Hello,

    How can I visualize my longitudinal dataset? I have a dataset in which I am interested in seeing the variation of the presence of metabolic syndrome over time for each participant. There are approximately 1,083 participants in my dataset with 1-8 visits each; there is a total of 3,090 observations. How can I see an overview of the variation for each participant on stata? Like a matrix of time series graphs possibly? Any guidance is appreciated!
    Thank you in advance!

  • #2
    I'm not sure what you want here. Any attempt to display 1,083 separate graphs in a single tableaux is doomed to produce something unreadable that will not shed any light on anything. Perhaps you could select a random sample of some modest number of participants, let's say 16 or fewer, and then use
    Code:
    xtset participant visit_num
    xtline met_syndrome
    on just those participants.

    From my perspective, what would be more enlightening would be to aggregate the data set up to get the overall prevalence of metabolic syndrome at each visit and then plot that. One would do that for the entire sample, or perhaps for interesting subsets. So something like

    Code:
    collapse (mean) met_syndrome, by(visit_num) // OR by(visit_num subset_indicator)
    graph twoway line met_syndrome visit_num, sort // ADD by(subset_indicator) if appropriate

    Comment


    • #3
      That would be a matrix of 1,083 graphs. You are not going to look at all of them, and even if you are you are not going to get an overview from that exercise. So you need to somehow summarize. What the exact summary is depends on what you want to learn. So, the question becomes: What do you want to learn from looking at these graphs?
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        The territory here is, in my opinion, one of the most important and interesting problem areas in statistical graphics. How to get an overview of many time series for a longitudinal or panel project, with, almost always, a great deal of heterogeneity?

        But what are the goals any way? To identify collective behaviour? To identify striking oddities? Both and yet more?

        There are lots of specific questions on the data from someone like me, not a clinician or medical scientist or medical statistician and at most a patient.

        Is the response a binary or indicator variable or something measured? Is time comparable for different people? From a lay perspective people are always being identified at different times with outcomes cured ... died at different times. Or is time more nearly standard in your data?

        As already flagged, producing 1000 separate graphs is likely to be unhelpful. You could send them all to a one big file, but would that help?

        Conversely, 1000 superimposed series in one graph is feasible but also not likely to be very helpful.

        It's often feasible to compare say 9 or 16 graphs in a 3 x 3 or 4 x 4 display. So, how could 9 or 16 or some other small number of subsets be identified?

        1. You may have existing categorical divisions.

        2. You may want to bin some important predictor into disjoint intervals. (For once, I identify a good use of binning.)

        3. Random subsets.

        The principle (no paradox) is that it can be easier to see patterns and anomalies with 50 or 100 series shown than with 1000.

        Comment


        • #5
          Another handle in this case is the number of observations in each panel. There could be systematic differences between those subsets.

          Comment


          • #6
            graph twoway (scatter xy ) (lfit x y ), xtitle(x) ytitle(x) title("Income")
            how i use this command for panel data
            can anyone help me thankyou

            Comment

            Working...
            X