[S] replacement of NAs in a factor

Zhaorong Jiao (z.jiao@qut.edu.au)
Tue, 15 Sep 1998 13:35:32 +1000 (EST)


Dear all, I am doing a survival analysis. In my data frame, there is a
variable called "date.death" which gives the date of death of patients.
Some of the values in the variable are NAs which indicate the patients are
still alive at the end of the study. The format of the values in the
variable is like 29/01/1987(DD/MM/YY). Now I like to replace the NAs with
a fixed date , say, 31/12/1998 used the following command:
dataframe$date.death[dataframe$date.death=="NA"]_"31/12/1998"
It gave me a error message saying the replacement values not all in
levels(x). It seems to me that I could do the similar replacement with old
version of Splus but now I can no longer do it with the newly version of
splus for window( I am using splus for window 4.5.). Can anyone out there
give me an idea on how to do this kind of replacement. Thank you.

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news