[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: finding a mean with empty obs cells
It helps a lot if you use standard Stata
terminology. Failing that, an example
When you say empty, you could mean at least
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.
tab id, su(myvar)
egen mean = mean(myvar), by(id)
just calculate from what you have.
> 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: