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

Nominal with quantitative variables

These comparisons are often examined using basic bar charts or, in the following example, using side-by-side box-plots. These boxplots give very clear comparisons.

The following code simulates two ad campaigns A, and B with two different outcomes:

set.seed(123)  rows=100 a <- data.frame(Sales=rnorm(rows,mean=75,sd=5),                 Treatment=factor(c("Campaign A"))) b <- data.frame(Sales=rnorm(rows,mean=80,sd=5),                 Treatment=factor(c("Campaign B"))) combined=rbind(a,b) #Boxplots which compare treatments  boxplot(Sales~Treatment,data=combined, main="Comparing Treatments",            xlab="Treatment", ylab="Sales")

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