Basic A/B Testing plots and stats with R

January 12, 2014
By

(This article was first published on Stats raving mad » R, and kindly contributed to R-bloggers)

Have you used Google Analytics Content Experiments?

I’ve been using it lately and the most useful thing is that all data are integrated into the API to do what you want to do except for the standard reports. So, you can get them into your favorite data analysis tool and get more things done. In the following I simulate an example for an e-commerce site, so I am interested in checking the next (among others)

  • did the proposed variation increased the Funnel entrances?
  • did the feature uplift the Average Order Value (AOV) ?
  • did the conversion rate (sales wise) improved?

We can easily accomplish this using the Google Analytics API and R. We have found a way to get data off Google Analytics using R previously  (see : Google Analytics + R = FUN!)

ab.test.comparison.Rplot

The code that gets the above chart into a presentation of yours is hosted over at GitHub. We source the multiplot.r file in order to be able to add multiple plot of the ggplot kind within a loop (see this)

..
initiate_RGoogleAnalytics.rFirst commit
multiplot.rFirst commit
plot_experiments_across_profiles.rFirst commit

 

To leave a comment for the author, please follow the link and comment on his blog: Stats raving mad » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.