Announcement

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

  • mi estimate, by(group)

    I can't see a simple way to analyze multiply imputed data by group. The code below fails. What am I missing?
    Code:
    mi estimate, by(dataset): regress y x
    option by(dataset) not allowed
    Last edited by paulvonhippel; 20 Jun 2025, 10:21.

  • #2
    I haven’t looked at the documentation in a bit, what does it say? The error message would imply that the mi suite doesn’t permit analysis by group. If that’s the case, you’ll need to perform analyses on one group at a time. I suspect this might be limitation (or feature) based on the additional metadata that Stata saves about the imputation process. It may also compound with the notion that not every by group would have the same specifications for imputation.

    Comment


    • #3
      Have you tried something like this?

      Code:
       levelsof dataset, local(groups)
      foreach i of local groups {  
        mi estimate: regress y x if dataset == `i'
      }

      Comment


      • #4
        I think the solution of Tiago Pereira is the only one. mi estimate is not byable and there is nothing documented about it. I am happy to be corrected on this issue but this is my current state of knowledge.
        Best wishes

        Stata 18.0 MP | ORCID | Google Scholar

        Comment

        Working...
        X