Statalist The Stata Listserver

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

st: replace missing values

From   "Cathy L. Antonakos" <>
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.
* For searches and help try:

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