Announcement

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

  • Analysis of a dataset with respect to group and time course

    Hi everyone,
    I have a dataset where an index of functional recovery has been calculated in 6 different groups of animals (12 animals per group, each group received a different treatment). The index has been recorded for 34 weeks. So, I have 34 records (time points) for each animal.
    I would like to assess if there are differences among the 6 groups, but also if there are differences over time.
    I was wondering which test would be more appropriate to do this.
    Is it correct to use repeated-measure two-way ANOVA?
    Are there other models I could use?
    Any suggestion is really appreciated.
    Thank you for any help.

  • #2
    Welcome to the forum! One solution to this kind of problem is as follows:

    Code:
    mixed depvar i.groupvar c.timevar || idvar:
    margins group
    
    *now testing for different trajectories
    mixed depvar i.groupvar##c.timevar || idvar:
    
    
    *testing for nonlinear effects
    mixed depvar i.groupvar##c.timevar##c.timevar || idvar:
    margins groupvar, at(timevar=(1(1)34))
    marginsplot
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      Thank you very much!

      What if the relationship between the index of functional recovery and the time is not linear?

      Comment


      • #4
        You can start with a purely descriptive approach to check this, like
        Code:
        scatter depvar time, by(groupvar)
        Best wishes

        Stata 18.0 MP | ORCID | Google Scholar

        Comment


        • #5
          Yes, sure.
          The relationship between the index of functional recovery and time is not linear, so I asked if the mixed model was correct.

          Many thanks!

          Comment


          • #6
            Well it depends on the kind of form. By introducing higher order terms (e.g. c.time##c.time) you can model squared, cubed,... forms. If this is not enough you could partition the time points into a few groups and then treat them as categorical (like i.timevar). Even more complex, you can estimate generalized ml models with meglm.
            Best wishes

            Stata 18.0 MP | ORCID | Google Scholar

            Comment


            • #7
              if you believe the relationship is non-linear but are unsure of the form, try restricted cubic splines; see
              Code:
              h mkspline
              or
              h makespline

              Comment

              Working...
              X