Try this (?)
replace Total_Score = avg if Total_Score==.
avg is meant to be the average of the 3 units you've already worked out.
I hope that helps.
Rodrigo Martell
<http://www.frontier-economics.com>
Frontier Economics Pty. Ltd.
395 Collins Street
Melbourne VIC 3000
Australia
www.frontier-economics.com
switch:
direct:
fax:
mobile:
email:
+61 (0)3 9620 4488
+61 (0)3 9613 1518
+61 (0)3 8614 2711
+61 (0)407 909 811
[email protected] <mailto:[email protected]>
This e-mail, including any attachments, may contain confidential and privileged information for the sole use of the intended recipient(s). Any review, use, disclosure or distribution by others is strictly prohibited. If you are not the intended recipient (or authorised to receive information for the recipient), please contact the sender by reply e-mail and delete all copies of this message. Thank you.
-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Cathy L.
Antonakos
Sent: Monday, 16 October 2006 1:51 PM
To: [email protected]
Subject: st: replace missing values (fwd)
Sending again with a formatting correction, to hopefully display the data correctly this time.
CA
--------------------
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/
*
* 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/