[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: replace missing values
I have a dataset with hospital and ICU data. I'd like to replace missing data for one ICU with the average value of the other 3 icu's at that hospital. The dataset looks like this:
Unit_ID Total_Score
11 .
12 90
13 60
14 27
I can get the average for total score for the 3 units by using "if" and specifying the unit id's. But how can I then replace the missing unit's score with the average from the 3 other units? I've tried several ways and searched online but can't find an answer to this specific problem.
Thanks for any help you can provide.
Cathy
*
* 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/