Re: [R] basehaz and newdata

2008-04-16 Thread mah
Survfit returns an Error in temp[, 1] : incorrect number of dimensions error message when I attempt to use newdata to validate my models. The syntax I am using is sfit - survfit(mod1, newdata=testd, individual=T). The dataframe testd has two columns and 39 rows (see below). The rows are the

[R] basehaz and newdata

2008-04-08 Thread Terry Therneau
The 'basehaz' function is just a wrapper for survfit, and includes only some of the arguments of the former. It's main reason for existence is that another more well known (but inferior :-) package uses that term. I don't understand the final comment in the exchange, however: I had been

[R] basehaz and newdata

2008-04-07 Thread mah
I am unable to get the basehaz function to apply a proportional hazards model to a new data frame. I replicated my specific situation with the example for coxph in the help, where I changed the x value of the first record from 0 to 1. Is there something incorrect in the syntax that I am using?

Re: [R] basehaz and newdata

2008-04-07 Thread Roland Rau
Hi, just looked at it briefly and I don't know if it is the real cause for your problems. But 'data' as well as 'newdata' require a data.frame and not a list as input. Does this help? Best, Roland mah wrote: I am unable to get the basehaz function to apply a proportional hazards model to

Re: [R] basehaz and newdata

2008-04-07 Thread mah
Thanks Roland, but using data frames does not resolve the issue. See revised code and output below: test1 - data.frame( + time= c(4, 3,1,1,2,2,3), + status=c(1,NA,1,0,1,1,0), + x= c(0, 2,1,1,1,0,0), + sex= c(0, 0,0,0,1,1,1)

Re: [R] basehaz and newdata

2008-04-07 Thread Austin, Matt
, denosumab PMO Biostatistics Director Amgen, Inc -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mah Sent: Monday, April 07, 2008 10:01 AM To: r-help@r-project.org Subject: Re: [R] basehaz and newdata Thanks Roland, but using data frames does not resolve

Re: [R] basehaz and newdata

2008-04-07 Thread mah
Yes, Thank you. I did not separate the arguments for basehaz from those for survfit in the documentation. I had been hoping the tedious alignment of the baseline curve with the value of the variables in the new data set would be [somehow] handled for me. On Apr 7, 12:27 pm, Austin, Matt [EMAIL