Announcement

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

  • Test for three paired samples

    Hello,

    In the study, the same patients came to see the doctor three times. 1st visit, 2nd visit (6 months after the first visit) and 3rd visit (6 months after the second visit). At each visit, patients had their blood pressure measured and were asked about their medications (patients answered yes/no for each medication). I need to answer the question of whether blood pressure and therapy varied at different visits. Should I use paired t-test or ANOVA?

  • #2
    You do not have three paired samples. You have matched triplets of observations. t-tests are not appropriate for this data. Repeated measures ANOVA is one possibility. Myself, I would use a two-level regression model such as -mixed-, with visits nested within patients.

    The foregoing refers to the blood pressure outcome. The treatment variable looks very complicated and I will abstain from making a recommendation for that. At the very least I would want to see example data, and I would need to know what you mean by "therapy varied." If you literally want to quantify all changes in treatment, it will involve fairly complicated handling since the number of combinations of blood pressure medicines, not to mention doses and frequencies, that you may encounter in the data is mind-boggling. Some sort of classification, perhaps based on pharmacologic categories to reduce the number of levels you have to deal with, will probably be needed. Or, if you are really just interested in "treatment unchanged across all three visits" vs "treatment changed some way at some time," then it's not hard: just create a 0/1 variable for each person and make a table of that to see how many patients fell into each of those two categories.

    Comment


    • #3
      Thank you, Clyde.
      I mean whether the therapy changes during the visits, ie. 1) whether the patient stopped taking drugs of a certain class, 2) if he/she did not stop, then whether the dose taken has changed (I made a column for this "Half of the maximum dose of the drug and more"). I have attached an example of my data presentation.
      ID ACEi (1 visit) Half of the maximum dose of ACEi and more (1 visit) CCB (1 visit) Half of the maximum dose of CCB and more (1 visit) BB (1 visit) Half of the maximum dose of BB and more (1 visit) ACEi (2 visit) Half of the maximum dose of ACEi and more (2 visit) CCB (2 visit) Half of the maximum dose of CCB and more (2 visit) BB (2 visit) Half of the maximum dose of BB and more (2 visit) ACEi (3 visit) Half of the maximum dose of ACEi and more (3 visit) CCB (3 visit) Half of the maximum dose of CCB and more (3 visit) BB (3 visit) Half of the maximum dose of BB and more (3 visit)
      1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0
      2 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0
      3 0 1 1 0 1 0 1 1 0 1 1 0 1 0
      4 0 0 1 1 0 1 0 1 0 1 1 0 1 0
      5 0 0 0 0 0 0 1 1 1 1 1 0
      6 1 1 1 0 0 1 0 1 0 0 1 1 0 0
      7 1 0 0 0 1 1 0 0 1 1 1 0 0
      8 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1
      9 0 0 1 0 0 0 0 1 0 0 0
      10 1 0 1 1 0 0 1 1 0 0 1 0 0
      11 0 1 1 1 0 0 1 1 0 0 1 0 0
      12 1 1 0 0 1 1 0 0 1 1 0 0
      13 0 0 1 0 1 1 0 0 1 0 0 0
      14 0 0 1 0 1 0 0 0 0 0 0
      15 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1
      16 0 1 0 1 0 0 0 1 1 0 0 0
      17 0 0 1 1 0 0 1 1 0 0 0
      18 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1
      19 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1
      20 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1
      21 1 1 0 1 0 1 1 0 1 1 1 0 0 1 1
      22 0 0 1 0 0 0 1 1 0 0 1 1
      23 0 1 1 1 0 0 1 0 0 0 0 0
      24 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1
      25 0 0 0 1 1 0 0 1 1 0 0
      26 1 0 1 1 0 0 1 0 0 0 1 1 0
      27 1 0 1 0 0 0 1 0 1 1 0 0 1 1
      28 0 1 0 1 0 0 1 0 0 0 1 1 0
      29 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 0

      Comment


      • #4
        The example data you show is clearly not from a Stata data set. Perhaps it's in a spreadsheet or some kind of text file. Before you can do anything analytic, you need to import your data to Stata. Anyway, to help you with specific code, you would need to use the -dataex- command to show a data example from your Stata data set. If you are running version 18, 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

        That said, it seems that by change in treatment you mean change among the various categories you show in #2. Still, it is not 100% clear. Do you want to separately analyze changes in beta blockers, changes in calcium channel blockers, changes in ACE inhibitors. Or just any change vs no change? And do you want to separately analyze changes between visits 1-2 and changes between visits 2-3, or just any change between 1 and 3?

        Comment


        • #5
          I wanted to first see if there was a difference in therapy for certain classes of drugs at three visits (I think Cochran's Q test is needed here), and then do a post hoc analysis with the McNemar test to determine which two groups were different.

          Comment


          • #6
            Perhaps I am misunderstanding the entire situation, but I don't see how Cochran's Q test would be relevant here. It tests whether multiple treatments have identical effects on some dichotomous outcome. I don't see what the dichotomous outcome is, nor do I see multiple statistical treatments in play here. What am I missing?

            Comment


            • #7
              Clyde, thank you very much for your patience. I should mention why I'm doing these comparisons. I need to know if the therapy affects arterial stiffness (measured in meters per second at each visit). Now I understand that I'm wrong, but still haven't found a solution.

              Comment


              • #8
                OK. I think it is going to be difficult to tease this information out of this data design unless there are a large number of patients who are starting and stopping different treatments during the course of our study. Drawing on your classification and dosing scheme, you can create a somewhat different data set where each patient has three observations in the data, one for each visit. The variables would be which visit it is (1, 2, or 3), the arterial stiffness measure at that visit, and a series of 0/1 indicator variables for the different treatment groups: full dose beta blocker, half-dose beta blocker, full-dose calcium-channel blocker, half-dose calcium-channel blocker, full dose ACE inhibitor, half-dose ACE inhibitor, etc. (By full-dose I mean here more than half-dose, and by half-dose I mean up to half-dose.) I would not, at least initially, make separate variables for the combinations. Those would be interactions of the single-treatment variables, and, if your sample has enough people in it and you have a theoretical basis for expecting the combinations to have effects that are not merely the sum of their separate effects, you can add those interaction terms to your model.

                I would use -xtreg, fe- as my regression model, with the arterial stiffness as the outcome variable and the treatment indicators as the explanatory variables, with a fixed-effect at the patient level. This regression model will appropriately exclude the people for whom a treatment never changes from the estimation of of that treatment's effects but will still extract as much information as is available from the other treatments. The use of the fixed-effects model also appropriately singles out the within-patient effect of each treatment on arterial stiffness (as opposed to between-patient effects of treatment which, in the absence of randomization of treatment, might arise spuriously because of treatment selection being based on things that might, themselves, be unobserved predictors of arterial stiffness).

                Comment

                Working...
                X