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 <dwinsem...@comcast.net> 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 
> to column names. 
> 
> — 
> David
> 
> Sent from my iPhone
> 
>> On Nov 5, 2017, at 7:21 PM, Meghna Govil via R-help <r-help@r-project.org> 
>> wrote:
>> 
>> 
>> 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,
>> train1_na$WEB,
>> train1_na$clearance_pcnt,
>> train1_na$bts_pcnt,
>> train1_na$sales_pcnt,
>> train1_na$holiday_pcnt,
>> train1_na$TXN,
>> train1_na$REDEEMED_REWARDS
>> 
>> )
>> 
>> # Kaplan-Meier non-parametric analysis 
>> 
>> kmsurvival_np <- survfit(Surv(time_np,event_np) ~ X_np)
>> 
>> Error in `[.default`(y, who, 1) : (subscript) logical subscript too long
>> 
>> Any ideas?  
>> I have tried several things and still get this error.  
>> 
>> 
>> Thanks,
>> Meghna
>> 
>> ______________________________________________
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
> 

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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