Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: replace missing values


From   "Cathy L. Antonakos" <[email protected]>
To   [email protected]
Subject   st: replace missing values
Date   Sun, 15 Oct 2006 23:46:48 -0400 (EDT)

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/




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