I have my data frame like this
Product_ID min_date max_date
1 2014-09-09 2014-09-09
2 2014-08-18 2014-09-16
3 2012-03-11 2014-11-01
4 2013-01-10 2014-05-02
5 2013-01-23 2014-10-20
6 2013-10-24 2013-10-24
7 2013-03-11 2013-03-11
Where min_date
and max_date
indicates the time boundary (start date of buying and last date of buying) for each product_ID
.
I have tried to fit cox proportional hazard using the following code
require(survival)
cox.model <- coxph(Surv(as.numeric(min_date, max_date)) ~ X + frailty(Product_ID), M)
M
is my data of the above form, It ran well.Now I am trying to predict customer churn and all other related survival analysis (KM estimate) and plot the churn & hazard rates. Help me please in this context.
I have managed to construct a data frame for 'transaction' type too, for the association rule analysis. It will be great if you can figure out any type of survival analysis by using the 'transaction' format data set in R programming.
Thanks.
Note:: link for LOESS plot http://192.168.2.165:8787/graphics/plot_zoom?width=881&height=475&scale=1