Dear all,
Thank you very much for the help you have provided on this matter. It has
certainly made things much clearer for me. I have enclosed a very clear
email from Richard Pugh that I found most useful, but was not posted on the
S-news site.
Just to provide some feedback:
Professor Ripley: Thank you for your suggestion, unfortunately when I used
fit$strata
All I got back was NULL, I?m wondering if I used it correctly?
Professor Harrell: Thank you. I?ve just discovered the design library after
buying your book and have tried it out, and it does work, although I am
still grappling with a number of issues regarding customising the labels and
size of the output for the n.risk functions. It is a very useful command.
Sincerely,
Eric Lim
Cambridge, UK.
From: "Richard Pugh" <rpugh@mango-solutions.com>
Reply-To: <Rpugh@mango-solutions.com>
To: "'Eric Lim'" <ericlim2@hotmail.com>
Subject: RE: [S] Identifying the lines in a km plot
Date: Tue, 5 Aug 2003 15:10:54 +0100
Hi Eric,
The quick answer is "yes", S-PLUS will use them in numeric order in this
instance. However, that's not the end of the answer ...
If your "group" variable is not a factor, it will be converted into one.
S will construct the factor levels in numeric / alphabetical order ...
In your case, the numbers 1 to 4 are converted to factor levels "1" to
"4" and given the line types in order as you supply them (1, 4, 6 then
8).
In your example of "Red", "Black", "Blue" and "Green", S will construct
the factor in alphabetical order ...
> levels(factor(sample(c("Red", "Black", "Blue", "Green"), 100, T)))
[1] "Black" "Blue" "Green" "Red"
... so care must be taken! Tricky problem to label "red" with red lines
etc. I would possibly do it using ...
pie(rep(1, 16), col=1:16)
.. then set up a vector for matching:-
ColNum Col
1 Black
2 Blue
.. ...
That's one idea .. there may be an easier way to do that ...
Hope this helps,
Rich.
Mango Solutions
Tel : (01628) 418134
Mob : (07967) 808091
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
|