Announcement

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

  • comparing two times if there are correlated datapoints within subject

    I have some data on eyes, where there were measurements done on two eyes within some of the subjects. I want to show that the time to decrease in variable A (vision) is different than the time to decrease in variable B (pressure) for eyes (there is only time from baseline to final follow-up, so not repeated measures over time). How would one do this while accounting for the fact that some of the subjects have measurements on two eyes (which are hence correlated)?

  • #2
    So, at least some of your data consists of pairs of observations on the same subject, each observation (with two variables, latency of response in vision and pressure) being carried out on a different eye. In general terms, then, you have a two-level model: eyes nested within people. There is a whole suite of commands in Stata that is dedicated to the analysis of two-level data: the -xt- series. Discussing the generalities of two-level data analysis would take far longer than is appropriate for a post of this kind. I suggest you start with the -xt- chapter of the [XT] volume of the PDF manuals that are part of your Stata installation (assuming you have version 11 or later). You may find it distracting that much of the discussion and most of the examples talk about "longitudinal" data where observations at different time points are nested within entities (often firms, because this kind of analysis is so frequently used in the economics and finance communities). But just substitute eyes for timepoints and people for firms (or communities or whatever) in your mind as you read. Basically, any kind of analysis you would do if you had observed only one eye in each person, has an analog in two-level data, some -xt- command that implements it.

    Comment


    • #3
      I understand that the eyes are nested w/in subject. What I'm not sure about is what kind of a hierarchical regression model would be able to show that time A is significantly different than time B? Given this is time, and is skewed, I thought a quantile regression would be reasonable but I don't believe there is a hierarchical option for quantile regression.

      Comment


      • #4
        Well, imagine that each subject had only been tested in one eye. You have two variables, time to vision and time to pressure and you want to know if they are different. The fact that their distributions are skewed has very little bearing on the matter. You could, for example, calculate the difference between the times and then test whether the mean difference is zero. While the simplest way to do that would be a one-sample ttest on the difference, it would be entirely equivalent to do it as a regression of the difference against just a constant term and test whether the constant is zero. That approach would have its analog using -mixed difference || person:- as well. I should add that even if both times are highly skew, the difference between the may not be. And even if that distribution is skew, in terms of inference from a regression (or from mixed) the central limit theorem will rescue that if your sample size is reasonably large. (Normality of distributions is highly overrated!) If your sample is small and the difference distribution is highly skewed, consider a skew-reducing transformation of the difference such as the cube root or the inverse hyperbolic sine. Or consider a GLM with a gamma link. All of these would be equally applicable in a two-level model.

        There are probably other approaches as well. I agree that quantile regression has not been implemented for two-level models. But nothing you've said so far persuades me that quantile regression is needed here.

        Comment


        • #5
          that makes sense. if i were to use meglm w/gamma link, would i need to upgrade (i have stata 12.1)?

          Comment


          • #6
            I am not certain, but I think -meglm- was not introduced until version 13. I no longer have any versions other than 15 operating on my computers, so I'm working from (unreliable) memory here.

            Comment

            Working...
            X