Announcement

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

  • Repeated Measures Data

    Hi,

    I am wondering if it is possible to conduct a pre and post analysis of data where a patient appears multiple times in the dataset in both the pre and post. The data example is below. Do I need to drop the subsequent visits by the patient or can I create averages of their visits so that I have the unique patient for comparison pre and post? Also, could I use this type of data in a mixed model? Thank you.

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(ID Pre Post)
    1 47 76
    2 33 66
    3 31 51
    3 54 40
    3 56 50
    4 45 70
    4 43 68
    5 45 63
    6 79 61
    7 59 37
    8 39 39
    9  . 35
    9 23 35
    9 49  .
    end
    ------------------ copy up to and including the previous line ------------------


  • #2
    Well, you don't say what kind of analysis you are hoping to carry out. But you cannot use ordinary statistical tests in this kind of data because they typically rely on the assumption that the observations are independent. When the same person is being reassessed, that assumption almost always fails.

    So, you will need to -xtset id- to tell Stata that you have this kind of data, and regressions you might do should use the -xt- suite of commands. For example, if your original plan was an analysis of covariance with the Post value as the outcome and the Pre value is a covariate (and perhaps some other predictor variables) it would look like:

    Code:
    xtset ID
    xtreg Post Pre
    For other kinds of analyses you will probably also need to reshape the data to long so that the Pre and Post values are separate observations, rather than separate variables:

    Code:
    gen long obs_no = _n
    rename (Post Pre) value=
    reshape long value, i(obs_no) j(_j) string
    xtset ID
    encode _j, gen(pre_post)
    drop _j
    
    // INSERT MORE COMPLICATED ANALYSIS USING AN XT COMMAND HERE

    Comment


    • #3
      Thank you Clyde. I am trying to assess whether there is a dose response in the pre and post measures if they made more visits to the intervention. I don't know if this is possible. For example, all patients had a baseline visit. Then, if there are 10 intervention visits (1 - 10), some patients made all 10 visits, some only made it to visits 1 and 2 and others 3, 6, 8 and 10 etc. Within the same week even, some patients came to visit 2, 3 times etc. So there is a variation to the number of visits. I would want to know

      1. Whether patient score improved overall from the initial visit to the overall post visits
      2. I would want to know if the number of visits impacted the improvement in that score
      3. Whether I can compare the baseline score to each visit score as well to see if the magnitude of improvement.

      Comment


      • #4
        These three goals are not very clear.

        1. What does "overall" mean here. Is it some combination of Pre and Post within each observation, or does it refer to the collection of all observations for a given ID, and including both the Pre and Post scores? And what constitutes improvement? What if the score improves from visit 1 to visit 3 but then deteriorates after that? All sorts of scenarios like this can arise. You need to come up with a very specific statement of what you want to examine here.

        2. This one is somewhat clearer, but depends on a clarification of 1. Do you expect a monotone dose-response effect? Or will it plateau at some point? Or perhaps it is even U-shaped or inverted U-shaped, or something like that? What do you expect?

        3. What does "baseline" score mean. Is it the Pre score on the first visit, or the Post score on the first visit? Or something calculated from them? And what is a "visit score?" Again, is it the Pre or the Post or some combination of those?

        I guess the point is that you can do all of these things in a large number of ways. You need to be precise in your own mind about exactly what you want to compare to what, and then you need to express that precisely in terms of specific variables or expressions involving variables and specific observations in the data.

        Comment


        • #5
          Thank you Clyde, these questions helped me to refine and generate my research questions better.

          Comment

          Working...
          X