I did not test to see if the design of the data.frame you offered was valid input to your model, since you did not provide a means to test it within R. I only meant to say that creating a very long vector with identical entries should not be necessary if the newdata argument were constructed properly. What _is_ needed is for newdata to have all of the variables on the RHS of the survfit formula.

Comparing your model, to the newdata argument :

out1<-coxph( Surv(tstart,tstop, death1) ~ chemo1+chemo1:log(tstop +1)+horm1+horm1:log(tstop+1)+age1+grade1+grade1:log(tstop +1)+positive1+positive1:log(tstop+1)+size1+size1:log(tstop+1), test1)

... I do not for instance see "tstop" defined in newdata. If the various survival prediction functions do not get a properly constructed newdata argument, they look to the original data values, which I believe is what is generating your error. I would think that tstop values would needed. It might be useful if you would, at the very least, provide the output from str(test1).

Let me also admit that I am unfamiliar with the strategy and interpretative implications of including a function of tstop on the RHS of a formula that involves tstop as a time variable on the LHS as well.

--
David

On Sep 22, 2009, at 12:28 PM, Λεωνίδας Μπαντής wrote:


If I use the following

newdata=data.frame(chemo1=0,
horm1=0,
age1=mean(age1),
grade1=0,
positive1=1,
size1=mean(size1)   )

then I get

Error in model.frame.default(Terms, newdata, ...) :
  variable lengths differ (found for 'log(tstop + 1)')
In addition: Warning message:
'newdata' had 1 rows but variable(s) found have 289205 rows


and
that is why I used "rep" to create the profile of a hypothetical subject I want to see.. I've
seen the help and the web and the syntax for a hypothetical subject is
indeed as you mentioned, but it is not working (or am I making a
mistake?). Once you declare newdata as the above then newdata is
only a row which will conflict with the dimensions of out1. Am I not
right?

But when I use the rep function to create 289205 zeros for chemo1 horm1 and so on I get an out of memory error.

I use Windows XP professional.

Thanx for your answer David.




___________________________________________________________
×ñçóéìïðïéåßôå Yahoo!;
ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíýìáôá (spam); Ôï Yahoo! Mail äéáèÝôåé ôçí êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí
ìçíõìÜôùí http://login.yahoo.com/config/mail?.intl=gr

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to