Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: finding a mean with empty obs cells


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: finding a mean with empty obs cells
Date   Tue, 6 Sep 2005 22:07:50 +0100

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 
[email protected] 

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index