O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recombining the churner and non-churners

Now that we have simulated the variables separately for the two groups, we will recombine them and then remove some of the NAs:

#bind them back together====d1 <- data.frame(xchurn.list)d2 <- data.frame(xnochurn.list)ChurnStudy <- rbind(d1,d2)ChurnStudy <- na.omit(ChurnStudy)summary(ChurnStudy)nrow(ChurnStudy)savehistory (file="ch5 generate churn data")

The str, summary, and nrow functions will output to the console, and the savehistory() function will save all of the commands that were run to an external file:

Notice that the summary output shows satisfaction as a factor and satisfaction2 as a character ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required