Announcement

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

  • xtmixed command combined with by() or bysort()

    Dear Statalists,

    Is it possible to run xtmixed command by different criteria? For example, I have a panel dataset where firms are nested in industries and industries in countries. I treat years as nonnested and would like to run the xtmixed model for every year separately, and for different Ys.

    Thank you in advance!
    Greets
    Jovana

  • #2
    Yes, by using a loop, typically. Something like:

    Code:
    forvalues year in 2010/2020 {
      xtmixed .... if year==`year', ...
      // do something with your estimates
    }
    By the way, -xtmixed- is the old command and has been superseded by -mixed-.

    Comment

    Working...
    X