It helps a lot if you use standard Stata
terminology. Failing that, an example
would help.
When you say empty, you could mean at least
two things:
1. No such cell exists as an observation
in your data.
2. The corresponding observation contains
a missing value.
Either way, Stata typically does the right thing
in calculating means. So you should need
to do nothing.
For example,
tab id, su(myvar)
or
egen mean = mean(myvar), by(id)
just calculate from what you have.
Nick
n.j.cox@durham.ac.uk
Jeff NASTERNAK
> I have a data set that has up to 30 observations for one ID.
> All the IDs go
> up to 30 observations but most have between 10 to 15
> observations. When I
> try to find the mean, how do I not take into account the
> empty cells for a
> particular ID?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/