Announcement

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

  • mixed: random slope for time in cross-classified longitudinal data (individuals × dyads)

    Hi all,

    I’m looking for guidance on specifying mixed-effects models in Stata for a cross-classified longitudinal dataset with repeated measures.

    Data structure:
    • Repeated observations over continuous time (months_since_base)
    • Individuals (newid) observed repeatedly
    • Observations are also cross-classified within non-nested dyads/partnerships (newpartid)
      • Individuals can appear in multiple dyads over time
      • Dyads are not nested within individuals
    • Both individuals and dyads have repeated measurements over time
    A simplified version of the model I’m fitting is:
    Code:
     
     mixed aes_mean_lag c.months_since_base || _all: R.newid || _all: R.newpartid
    Here are my questions:
    1. Random slope for time
      In mixed, does specifying a random slope for time require including a random intercept at that level (e.g., || newid: months_since_base, cov(unstructured)), or can time be specified alone as a random coefficient?
    2. Appropriate level(s) for random slopes
      In a cross-classified repeated-measures setting, is it reasonable to allow the time slope to vary at the individual level, the dyad level, or both? Are there recommended diagnostics or decision rules to guide this choice?
    3. Model-building strategy
      Any best-practice advice for building these models incrementally (random intercepts only → add random slopes → relax covariance structure), particularly for choosing between independent vs correlated intercept/slope terms?
    Below is a brief snippet illustrating the structure (full dummy dataset attached):

    Code:
    clear
    input str12 partnership str5 id float(months_since_base aes_mean_lag)
    "ID001--ID006" "ID001"    0 .
    "ID001--ID006" "ID001" 1.68 1
    "ID001--ID009" "ID001" 4.71 4
    "ID006--ID001" "ID006"    0 .
    "ID006--ID001" "ID006"  2.1 3
    "ID009--ID001" "ID009"    0 .
    "ID009--ID001" "ID009" 3.45 2
    end

    Many thanks in advance for any guidance.
    Attached Files

  • #2
    Maia,

    Cross-classified models are very complicated and Stata's mixed has some limitations around random slopes. I would suggest you study up on this topic before running a bunch of models. A very good source is U Bristol's LEMMA on multilevel models, which has a dedicated section on cross-classified models. Stata's ME model also has a little information on "crossed-effects models."

    As to your questions:
    1. In order to estimate a random slope in mixed, the intercept it is associated with cannot have an _all: R. in front of the intercept variable. Thus, for whatever intercept you want to estimate a time slope for, you need to remove the _all R. in front of it. As long as the other intercept has the all: R. designation, you preserve the cross-classification for modeling purposes. See Marchenko's Stata Journal article for more information about this.
    2. As mentioned in #1, you can only specify the random slope for one of the crossed random intercepts, not both. So you will have to choose based on your substantive knowledge and theory about the outcome under consideration and how you believe it changes. You could, in theory, try alternating the intercept that gets the time random slope and compare the AIC and BIC of those models to see if one provides better predictive possibilities (lower AIC and BIC). But you cannot use likelihood ratio testing because the two models have the same degrees of freedom.
    3. In general, start simple and ideally, use theory and substantive knowledge to add in complexity. Draw yourself a DAG to help you think about how to deal with selection problems.

    Comment

    Working...
    X