滞后分析rstudio_使用RStudio进行A / B测试分析

滞后分析rstudio

The purpose of this article is to provide some guide on how to conduct analysis of a sample scenario A/B test results using R, evaluate the results and draw conclusions based on the analysis.

本文的目的是提供一些指南,说明如何使用R对示例场景A / B测试结果进行分析,评估结果并根据分析得出结论。

Before we begin, let’s review what an A/B Test means and what it is typically used for and what are some of its limitations.

在开始之前,让我们回顾一下A / B测试的含义,通常的用途以及它的一些局限性。

定义 (Definition)

A/B Testing also known as split testing is a general methodology used online when you want to test a new product or feature. The goal is to design an experiment that is robust and gives repeatable results so as to make an informed decision to launch or not.

A / B测试(也称为拆分测试)是您要测试新产品或功能时在网上使用的一种通用方法。 目标是设计一个健壮的实验,并给出可重复的结果,以便做出是否启动的明智决定。

Typically, this test involves comparing two web pages by showing two variants A and B, to a similar number of visitors and the variant which gives better conversion rate wins.

通常,此测试涉及通过将两个变体A和B展示给相似数量的访问者来比较两个网页,并且变体可以带来更好的转化率。

It is mainly an experiment where two or more variations of the same webpage are compared against each other by displaying them to real-time visitors to determine which one performs better for a given goal. A/B testing is not limited by web pages only, you can A/B test your emails, popups, sign up forms, apps and more.

这主要是一项实验,通过向实时访问者显示同一网页的两个或多个变体进行比较,以确定哪个变体在给定目标下效果更好。 A / B测试不仅限于网页,您可以A / B测试电子邮件,弹出窗口,注册表单,应用程序等。

Typically one of many reasons why an A/B test is done is to ensure new features planned to be introduced do have a measurable (positive) impact on the intended objective for wanting to introduce such feature(s).

通常,进行A / B测试的许多原因之一就是要确保计划引入的新功能确实对想要引入此类功能的目标具有可衡量的(积极的)影响。

局限性 (Limitations)

A/B test is one of many tools for conversion optimization. It is not an independent solution. It won’t fix all your conversion issues. It can’t fix typical issues you get with messy data. You need to do more than just an A/B test to really improve on conversions

A / B测试是许多用于转化优化的工具之一。 这不是一个独立的解决方案。 它不能解决您所有的转换问题。 它无法解决因凌乱的数据而引起的典型问题。 您要做的不只是A / B测试,还可以真正改善转换率

Now, let’s take a dive into a practical example of a case study. The datasets and full analysis details can be found on my github If you need some help understanding and using Github, there is a useful link for beginners here.

现在,让我们深入研究一个案例研究的实际示例。 该数据集和全面分析的细节上可以找到我的GitHub如果你需要一些帮助了解和使用Github上,有初学者有用的链接在这里 。

案例分析 (Case Study)

Imagine we have results of A/B tests from two hotel booking websites. (Note: data is made up to look like the real one.) We need to conduct A/B test analysis of the data, draw conclusions from the data and make recommendations to management or product teams.

想象一下,我们有两个酒店预订网站的A / B测试结果 。 (注意:数据组成看起来像真实的一样。)我们需要对数据进行A / B测试分析,从数据中得出结论,并向管理层或产品团队提出建议。

Note: The analysis below assumes some little knowledge of statistical concepts so as to make it concise and to the point.

注意:下面的分析假设您对统计概念有些了解,以使其简洁明了。

数据集摘要 (Dataset Summary)

  1. Variant A is the control group which depicts the existing products or features on the website.

    变体A是一个对照组,描述了网站上的现有产品或功能。
  2. Variant B is the experimental group to experiment the new version of product or feature to see if users like it or if it increases bookings (conversions).

    变体B是一个实验小组,用于测试产品或功能的新版本,以查看用户是否喜欢它或它是否增加了预订(转化)。
  3. Converted — Based on the given dataset, there are two categories defined by logical values (True or false):

    已转换-根据给定的数据集,由逻辑值定义了两个类别(“真”或“假”):
  4. Converted = True when customer successfully makes a booking

    当客户成功进行预订时,已转换= True
  5. Converted = False when customer visits the sites but does not make a booking

    当客户访问网站但未进行预订时,Converted = False

检验假设 (Test Hypothesis)

零假设 (Null Hypothesis)

Both version A and B have the same probability of driving customer booking or conversion. In other words, there is no effect or no difference between version A and B.

版本A和版本B具有相同的驱动客户预订或转化的可能性。 换句话说,版本A和B之间没有影响或没有区别。

替代假设 (Alternative Hypothesis)

Both version A and B have a different probability of driving customer booking or conversion. There is a difference between version A and B. Version B is better than A in driving customer bookings. PExp_B != Pcont_A

版本A和版本B具有不同的驱动客户预订或转化的可能性。 版本A和版本B之间存在差异。在推动客户预订方面,版本B优于版本B。 PExp_B!= Pcont_A

分析 (Analysis)

Let’s do the analysis together. Download the dataset here. Please note you must have RStudio installed to do this.

让我们一起做分析。 在此处下载数据集。 请注意,您必须安装RStudio才能执行此操作。

  1. Prepare the dataset and load the tidyverse library which contains the relevant packages used for the analysis.

    准备数据集并加载tidyverse库,该库包含用于分析的相关软件包。
library(tidyverse)
setwd(“~egot_\\Projects\\ABTest”) #set up your own directory
ABTest <- read.csv("Website Results.csv", header = TRUE)#Using read.csv base R file import function so the data can be imported into a dataframe in RStudio.
save(ABTest, file = "~rda\\ABTest.rda") #save in your own directory

2. Let’s filter conversions for variants A & B and compute their corresponding conversion rates.

2.让我们过滤变体A和B的转化并计算其相应的转化率。

3. Let’s compute the relative uplift using conversion rates A & B. The uplift is a percentage of the increase.

3.让我们使用转化率A和B计算相对提升。提升是增量的百分比。

uplift <- (conv_rate_B - conv_rate_A)/ conv_rate_A * 100
uplift #82.72%
#B is better than A by 83%. This is high enough to decide a winner.

4. Let’s compute pooled probability, standard error , margin of error and difference in proportion (point estimate) for variants A & B.

4.让我们计算变体A和B的合并概率,标准误差,误差容限和比例差异(点估计)。

5. Let’s compute the z-score.

5.让我们计算z得分。

#5a. Compute the Z-score so we can determine the p-value
z_score <- d_hat/SE_poolprint(z_score) #2.249546

6. Using this z-score, we can quickly determine the p-value via a look-up table, or using the code below:

6.使用此z分数,我们可以通过查找表或以下代码快速确定p值

#5b.Let's compute p_value using the z_score value
p_value <- pnorm(q = -z_score, mean = 0, sd = 1) * 2print(p_value) #0.02447777

7. Let’s compute the confidence interval for the pool

7.让我们计算池的置信区间

8. Let’s visualize the results computed so far in a dataframe (table):

8.让我们在数据框(表)中可视化到目前为止所计算的结果:

模型 (Model)

Based on the computations made so far, i created a model for computing ABTests. You can simply throw in your file with corresponding ABTest results in exactly same format as the file i used and once you run this model your ABTest result will be computed and returned to you within seconds.

基于到目前为止的计算,我创建了一个用于计算ABTests的模型。 您可以简单地将文件和相应的ABTest结果以与我使用的文件完全相同的格式放入文件中,一旦运行此模型,ABTest结果将被计算并在几秒钟内返回给您。

AB Test Model
AB测试模型
Image for post

10. Finally let’s visualize the results of A & B using a normal distribution.

10.最后,让我们使用正态分布可视化A和B的结果。

Image for post

结论与建议 (Conclusions & Recommendation)

1. There are 721 hits and 20 conversions for variant A and 730 hits and 37 conversions for variant B.

1.变体A有721个匹配和20个转换,变体B有730个匹配和37个转换。

2. Relative uplift of 82.72% based on a Conversion rate for A = 2.77%, Conversion rate for B = 5.07%. Hence variant B is better than A by 82.72%.

2.基于A的转化率= 2.77%,B的转化率= 5.07%,相对提升为82.72%。 因此,变体B比A好82.72%。

3. P-value computed for this analysis was 0.02448 (p < 0.05 or p lower than 5% significance level). Hence, the tests results show strong statistical significance. You can be 95% confident that this result is a consequence of the changes made and not a result of random chance.

3.为此分析计算的P值为0.02448(P <0.05或P低于5%的显着性水平)。 因此,测试结果显示出很强的统计学意义。 您可以95%确信此结果是所做更改的结果,而不是随机机会的结果。

4. Based on the aforementioned results that show strong statistical significance. you should reject the null hypothesis and proceed with launch.

4.基于上述结果,具有很强的统计学意义。 您应该拒绝零假设并继续进行发布。

5. Hence, Accept variant “B” and roll it out for 100% of the users.

5.因此,接受变体“ B”并将其推广给100%的用户。

Note: Please check for the entire source code including the visualization on my Github repository.

注意:请检查完整的源代码,包括我Github存储库中的可视化文件。

Thanks for reading.

谢谢阅读。

翻译自: https://medium.com/@etomaa/a-b-testing-analysis-using-rstudio-c9b5c67d6107

滞后分析rstudio

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388580.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux程序实现弹框,jQuery实现弹出框 效果绝对美观

使用到JQeury写的几个比较好的Popup DialogBox,觉得不错。和大家分享下。使用它们结合.net可以实现很好的效果。1.jqpopup:是个可以拖拽,缩放并可以在它上面显示html页面上任何一个控件组合的控件。可以和后面的主页面通信。使用方法:先调用这几个js文件,可以自提供的下载地址下…

MySQL的事务-原子性

MySQL的事务处理具有ACID的特性&#xff0c;即原子性&#xff08;Atomicity)、一致性&#xff08;Consistency&#xff09;、隔离性&#xff08;Isolation&#xff09;和持久性&#xff08;Durability&#xff09;。 1. 原子性指的是事务中所有操作都是原子性的&#xff0c;要…

大型网站架构演变

今天我们来谈谈一个网站一般是如何一步步来构建起系统架构的&#xff0c;虽然我们希望网站一开始就能有一个很好的架构&#xff0c;但马克思告诉我们事物是在发展中不断前进的&#xff0c;网站架构也是随着业务的扩大、用户的需求不断完善的&#xff0c;下面是一个网站架构逐步…

linux的磁盘磁头瓷片作用,Linux 磁盘管理

硬盘物理结构以下三张图片都是磁盘的实物图&#xff0c;一个磁盘是由多块堆放的瓷片组成的&#xff0c;所以磁头的结构也是堆叠的&#xff0c;他要对每一块瓷片进行读取&#xff0c;磁头是可以在不同磁道(在瓷片的表现为不同直径的同心圆&#xff0c;磁道间是有间隔的)之间移动…

多层插件开发框架

先来几张效果图&#xff1a; 1.基于DATASNAP构建的中间件&#xff0c;中间件已经经过实际项目的检验&#xff0c;单台中间件可支持几千客户端&#xff0c;中间件可集群 2.中间件支持同时连接ACCESS\SQL SERVER\MYSQL\ORACLE。。。多种数据库系统 3.中间件同时支持TCP/IP,HTTP&a…

unity3d 可视化编程_R编程系列:R中的3D可视化

unity3d 可视化编程In the last blog, we have learned how to create “Dynamic Maps Using ggplot2“. In this article, we will explore more into the 3D visualization in R programming language by using the plot3d package.在上一个博客中&#xff0c;我们学习了如何…

详谈P(查准率),R(查全率),F1值

怎么来的&#xff1f; 我们平时用的精度accuracy&#xff0c;也就是整体的正确率 acc predict_right_num / predict_num 这个虽然常用&#xff0c;但不能满足所有任务的需求。比如&#xff0c;因为香蕉太多了&#xff0c;也不能拨开人工的一个一个的看它的好坏(我爱吃啊&#…

网站系统分布式架构

写这篇文章之前&#xff0c;需要有些论点和论据&#xff0c;以表明网络系统在极端情况下的情况&#xff0c;先来看看世界上排名靠前的网站。 1、 FaceBook 2、 Google 从这两个站可以看出&#xff0c;当下比较极限的日均访问量在2~3亿&#xff0c;PV值…

python 数据科学 包_什么时候应该使用哪个Python数据科学软件包?

python 数据科学 包Python is the most popular language for data science. Unfortunately, it can be tricky to know which of the many data science libraries to use when. ☹️Python是数据科学中最流行的语言。 不幸的是&#xff0c;要知道何时使用许多数据科学库中的哪…

Go语言开发环境配置

http://blog.csdn.net/hil2000/article/details/41261267/ 一.我为什么要学习go语言 当今已经是移动和云计算时代&#xff0c;Go出现在了工业向云计算转型的时刻&#xff0c;简单、高效、内 置并发原语和现代的标准库让Go语言尤其适合云端软件开发&#xff08;毕竟它就是为此而…

熊猫tv新功能介绍_您应该知道的4种熊猫绘图功能

熊猫tv新功能介绍Pandas is a powerful package for data scientists. There are many reasons we use Pandas, e.g. Data wrangling, Data cleaning, and Data manipulation. Although, there is a method that rarely talks about regarding Pandas package and that is the …

win与linux渊源,微软与Linux从对立走向合作,WSL是如何诞生的

原标题&#xff1a;微软与Linux从对立走向合作&#xff0c;WSL是如何诞生的正文Windows Subsystem for Linux(WSL)的开发&#xff0c;让微软从Linux的对立面走向合作&#xff0c;并且不断加大对开源社区的支持力度。而作为微软历史上的重要转折点&#xff0c;外界对WSL技术在Pr…

MFC80.DLL复制到程序目录中,也有的说复制到安装目录中

在用VS2005学习C调试程序的时候&#xff0c;按F5键&#xff0c;总提示这个问题&#xff0c; 不晓得什么原因&#xff0c;网上有的说找到MFC80.DLL复制到程序目录中&#xff0c;也有的说复制到安装目录中&#xff0c;可结果很失望&#xff0c;也有的VS2005安装有问题&#xff0…

vs显示堆栈数据分析_什么是“数据分析堆栈”?

vs显示堆栈数据分析A poor craftsman blames his tools. But if all you have is a hammer, everything looks like a nail.一个可怜的工匠责怪他的工具。 但是&#xff0c;如果您只有一把锤子&#xff0c;那么一切看起来都像钉子。 It’s common for web developers or databa…

树莓派 zero linux,树莓派 zero基本调试

回家之前就从网上购买了一堆设备&#xff0c;回去也不能闲着&#xff0c;可以利用家里相对齐全的准备安装调试。结果人还没回来&#xff0c;东西先到了。购买的核心装备是树莓派zero w&#xff0c;虽然已经知道它比家族大哥树莓派小不少&#xff0c;但拿到手里还是惊奇它的小巧…

简单的编译流程

简易编译器流程图: 一个典型的编译器&#xff0c;可以包含为一个前端&#xff0c;一个后端。前端接收源程序产生一个中间表示&#xff0c;后端接收中间表示继续生成一个目标程序。所以&#xff0c;前端处理的是跟源语言有关的属性&#xff0c;后端处理跟目标机器有关的属性。 复…

广告投手_测量投手隐藏自己的音高的程度

广告投手As the baseball community has recently seen with the Astros 2017 cheating scandal, knowing what pitch is being thrown gives batters a game-breaking advantage. However, unless you have an intricate system of cameras and trash cans set up, knowing wh…

验证部分表单是否重复

1. 效果 图片中的名称、机构编码需要进行重复验证2. 思路及实现 表单验证在获取数据将需要验证的表单数据进行保存this.nameChangeTemp response.data.orgName;this.codeChangeTemp response.data.orgCode; 通过rule对表单进行验证 以名字的验证为例rules: {orgName: [// 设置…

python bokeh_提升视觉效果:使用Python和Bokeh制作交互式地图

python bokehLet’s face it, fellow data scientists: our clients LOVE dashboards. Why wouldn’t they? Visualizing our data helps us tell a story. Visualization turns thousands of rows of data into a compelling and beautiful narrative. In fact, dashboard vi…

用C#写 四舍五入函数(原理版)

doubled 0.06576523;inti (int)(d/0.01);//0.01决定了精度 doubledd (double)i/100;//还原 if(d-dd>0.005)dd0.01;//四舍五入 MessageBox.Show((dd*100).ToString()"%");//7%,dd*100就变成百分的前面那一部分了