Announcement

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

  • Treatment varying over time inside individuals

    Dear Service,
    I have following structure for a panel data with dependent variable = X, Visit (I also have date of visit) and Treatment which vary inside a subject = ID.When a treatment fails it is replaced by a new one:
    ID Visit (or date of visit) X Treatment
    1 1 3.5 INF
    1 2 4.1 ETA
    1 3 3.4 ETA
    1 4 2.9 ABA
    2 1 1.2 ETA
    2 2 3.4 ETA
    2 3 2.1 ABA
    3 1 1.1 INF
    4 1 0.9 ABA
    My objective is to compare the values of X between treatments but I don't know how to deal with the fact that within the same subject there is more than one treatment.
    How can I handle this in a random coefficients model (as for example mixed X Visit Treatment || ID:, cov(unstruc)?
    Thank you very much.
    Jorge

  • #2
    Jorge:
    why not considering a fixed effect model, instead, aiming at detectin possible difference within the same panel?
    Code:
    xtset ID visit
    xtreg X i.treatment i.visit <otherpredictors>, fe
    As a pedantic aside, please note that this is not a service (that implies that people are paid for doing something for someone) but a forum where posters contribute to according to their willingness to learn and to help. Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo,
      Thank you very much for your advice and sorry for the unfortunate way of addressing the Forum.
      One of the continuous variables I have to analyze, reports an excess of zeros, ranging from 0 to 3 (0, 0.34, 1.57, ...). I was looking at the ziologit command but it only considers ordinal variables. Is there some way to fit a fixed effects model considering zero excess other than count models as Poisson or negative binomial?. Perhaps we could round the values eliminating decimals?
      Thank you again,
      Jorge


      Comment


      • #4
        Jorge:
        nothing sinister in addressing the forum (just a pedantic welcome advice ).
        That said, what is the proportion of zeros in your regressand?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hi Carlo,
          The total percentage of zeros is 32%, decreasing along visits. There are 105 visits along 20 years..
          Thank you,
          Jorge

          Comment


          • #6
            Jorge:
            do the zeros in X convey the same piece of information?
            That is, if a given patient does not show up at a scheduled visit, is her/his X value missing or 0?
            Last edited by Carlo Lazzaro; 21 Dec 2022, 23:46.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hi Carlo,
              The zeros refer only to dependent variable values. In case the patient didn't attend the visit the value for the dependent variable is a missing value.

              Taking advantage of this message I'm attaching a figure for other variable (DAS28) for which I fit the model you proposed me:
              xtset ind visit xtreg DAS28 i.treatment i.visit, fe The mean of DAS28 is the mean of all patients in each visit. With so many visits (99) how can I manage possible interaction between treatment and visit ? Thank you again for your help
              Click image for larger version

Name:	DAS28.jpg
Views:	1
Size:	114.0 KB
ID:	1694523


              Comment


              • #8
                Jorge:
                provided that if T>N, -xtreg- should be replaced with -xtregar-, I would not interact treatment and visit, as I I expect it to be too cumbersome (if informative at all) to disseminate.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Thank you Carlo!, I will try autoregressive model.
                  Any idea about excess of zeros of the other variable?

                  Comment


                  • #10
                    Jorge:
                    this issue is related to the data generating process you're investigating.
                    If zeros are allowed for whatener reason (and all the zeros have the same meaning) you should simply live with them.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Carlo,
                      Ok. I will explore change from Baseline at some time point using a mixed-effects model for repeated measures but only with the firt line of treatment.
                      Thank you very much for your valuable advices.
                      Jorge

                      Comment

                      Working...
                      X