Announcement

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

  • Time varying covariates and logistic regression

    I am trying to predict the outcome of a binomial dependent variable based on multiple measurents over time of a single variable measured prior to the outcome variable. Is it possible to do logistic regression in Stata with a time varying covariate nested within the individual? If not, any other suggestions on modeling this?

  • #2
    Have you looked at xtlogit, or am I missing something regarding your question?

    Comment


    • #3


      I think Mike is referring to just a single outcome. If so, and if the measurements were taken at a small number of fixed intervals (after enrollment in a study, then all four can be entered as predictors. Otherwise, the predictors can be one or more per-person summaries of the measurements. The following come to mind, organized into categories of location, variation, and trend.

      1. Mean
      2. Median
      3. A mean that puts more weight on recent measurements

      4. Standard deviation.
      5. Inter-quartile distance

      6. Linear trend (slope from a simple linear regression on time).
      7. Linear trend in more recent measurements
      Last edited by Steve Samuels; 22 Oct 2014, 18:21.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        There are more than 15 measures, with equal spacing, for each individual. As correctly pointed out by Steven, the outcome is only measured once - hence, I am uncertain if xtlogit is appropriate. I've tried the different summary measurements also incl area under the curve-however, I thought the collapsing of the data like that would decrease the power of the test in detecting a difference by decreasing the amount of information and variability.

        Comment


        • #5
          You don't have to restrict the analysis to just one summary measure at a time. A hypothesis test of of no association with >15 measurements is a simultaneous test of >14 comparisons. This test is likely to have lower power than one based on a few well-chosen summaries.
          Last edited by Steve Samuels; 23 Oct 2014, 06:59.
          Steve Samuels
          Statistical Consulting
          [email protected]

          Stata 14.2

          Comment


          • #6
            I have the same problem. The issue is that on one hand, repeated measurements aren't independent, on the other, the shape of the relationship between time-varying covariates and outcome and the effect of time are lost using summary measures. Consider for example 3 timepoints, and individual i from group A has 5, 4, 6. Individual j from group B has 1, 4 ,8. Further, consider for example that the timepoint for i are 0, 60 , 90 days, and for j are 0, 100 , 400. Obviously, a single summary measure cannot contain all that info
            Maybe I'm having a brain freeze and missing something obvious, any suggestions 9 years later?
            Many thanks!



            Last edited by Nazzarena; 07 Sep 2023, 15:44.

            Comment


            • #7

              Here is a portion of actual data where R is the response variable and v are the time-varying covariates. Beside the need to accommodate panel data I have a bit of zero inflation too .
              idn days R v1 v2 v3 v4 v5 v6 v7 v8 v9
              13 5 0 1 0 60 0 0 40 60 0 0 40
              14 5 92 1 0 0 0 0 0 0 0 0 0
              15 5 167 1 0 0 0 0 0 0 0 0 40
              16 6 0 0 67 0 160 0 100 0 53 73 0
              17 6 92 0 0 0 73 0 0 0 0 0 0
              18 6 246 0 0 0 120 0 127 40 0 0 0
              19 7 0 1 0 0 0 0 0 0 0 0 0
              20 7 154 1 0 0 0 0 0 0 0 53 0
              21 7 378 1 0 40 0 0 0 0 0 0 0
              28 10 0 0 0 0 0 0 0 0 0 0 287
              29 10 85 0 0 0 0 0 0 0 0 0 147
              30 10 169 0 0 0 0 0 0 0 0 0 227

              Comment


              • #8

                well the formatting doesn't really help... Please see the attached if needed
                Attached Files
                Last edited by Nazzarena; 08 Sep 2023, 10:58. Reason: no way to render delimited data

                Comment

                Working...
                X