Announcement

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

  • egen mean - missing value for some observations

    Dear Statalisters,

    this might be a rudimentary question:

    I use the following code to generate mean for each industry and year combination,

    bysort industryid year: egen mean_xvar=mean(xvar)


    xvar is missing for a subset of my sample, I know the above statement still works,

    is it correct to say that mean is generated without considering the missing observations?

    Thanks
    Rochelle




  • #2
    I don't know what alternatives you are imagining, but Stata does ignore missing values in this computation, unless all values in a given group are missing. . (Presumably, "missing observations" means observations with missing values.) That is, there is no interpolation, imputation, or other replacement.

    Comment

    Working...
    X