Re: [R] Survival model error

2017-11-06 Thread David Winsemius
> On Nov 6, 2017, at 5:45 AM, Meghna Govil wrote: > > Thanks David. Could you show me how to do that in my example ? Possibly: kmsurvival_np <- survfit(Surv( tte, censored) ~ . , data=train1_na) I say "possibly" because I don't know whether all the columns of `train1_na` were included in th

Re: [R] Survival model error

2017-11-06 Thread Michael Dewey
Try putting your data.frame (train_na) as argument to the data= parameter and then in the formula put the actual variable names but without the train_na$ prefix. On 06/11/2017 13:45, Meghna Govil via R-help wrote: Thanks David. Could you show me how to do that in my example ? Thanks, Meghna

Re: [R] Survival model error

2017-11-06 Thread Meghna Govil via R-help
Thanks David. Could you show me how to do that in my example ? Thanks, Meghna > On Nov 6, 2017, at 12:58 AM, David Winsemius wrote: > > You should stop trying to use matrices on the RHS and using separate vectors > to Surv. Instead use a data argument and have the names in your formula refer

Re: [R] Survival model error

2017-11-05 Thread David Winsemius
You should stop trying to use matrices on the RHS and using separate vectors to Surv. Instead use a data argument and have the names in your formula refer to column names. — David Sent from my iPhone > On Nov 5, 2017, at 7:21 PM, Meghna Govil via R-help > wrote: > > > Hi - Below is my co

[R] Survival model error

2017-11-05 Thread Meghna Govil via R-help
Hi - Below is my code and then the error when I run the last line. time_np <- train1_na$tte event_np <- train1_na$censored X_np <- cbind( train1_na$AMT, train1_na$DISCOUNT_AMT, train1_na$high_price_pcnt, train1_na$EM_RECEIVED, train1_na$DM_RECEIVED, train1_na$TXN_WITH_RINGCODE,