Thanks Terry, for the insight into an old problem about predict() and
poly() functions with survReg and the messy dependency of dummy variables
and coefficients from the predict function on the range of data specified
in newdata rather than the original.
I imagine that in order to maintain the polynomial form, I should specify
it differently in the model? such as x+x^2?
Further, will the smartpred library (Yee), deal with the survReg models?
cheers
andrew
At 13:22 18/09/01 -0500, you wrote:
You are getting bit by a famous bug: take poly() out of your equation
and all
will be well.
Why -- the dummy variables generated by poly() depend on the range of x,
so your coefficients and your predictions are based on different sets of
dummy variables.
Take home message: a design shortcoming in Splus, which could be fixed
fairly simply. But my suggestion to fix it has always met with "but that
might break some existing code". My response -- probably not, but if it did
the change would be to now give correct answers.
Terry Therneau
Dr. Andrew Beckerman
Institute of Biological Science
University of Stirling, Stirling FK9 4LA, Scotland, UK
phone:+44 (0)1786 467808 fax: +44 (0)1786 464994
--
The University of Stirling is a university established in Scotland by
charter at Stirling, FK9 4LA. Privileged/Confidential Information may
be contained in this message. If you are not the addressee indicated
in this message (or responsible for delivery of the message to such
person), you may not disclose, copy or deliver this message to anyone
and any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. In such case, you should destroy this
message and kindly notify the sender by reply email. Please advise
immediately if you or your employer do not consent to Internet email
for messages of this kind. Opinions, conclusions and other
information in this message that do not relate to the official
business of the University of Stirling shall be understood as neither
given nor endorsed by it.
|