Announcement

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

  • average observations for nested variables

    Hi all,

    I have a 3-level multilevel model calculated using mixed. I am wondering how I can find the average # of observations of the level 2 variable within the level 3 variable? That is, I have clients who are nested by therapists. Is there any easy means by which I can obtain the average number of clients seen by therapists with these multilevel/panel data?

    Thanks!

  • #2
    Theodore:
    I'd think about somethng along the following lines:
    Code:
    bysort therapists: egen wanted=count(clients)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks so much Carlo! I obtained the count with the syntax you provided then added:

      by therapist: gen thersequence = _n

      Thereafter:

      sum wanted if thersequence==1

      I think this let me get the first observation of therapist with wanted on that observation line to obtain average number of clients by therapist. Much appreciated!

      Comment

      Working...
      X