- Training Systems Using Python Statistical Modeling
- Curtis Miller
- 300字
- 2021-06-24 14:20:44
Testing for common proportions
Now, let's move on to comparing the proportions between two samples. We want to know whether the samples were drawn from populations with the same proportion or not. This could show up in the context, such as A/B testing, where a website wants to determine which of two types of ads generates more clicks.
We can still use the statsmodels function, proportions_ztest(), but we now pass NumPy arrays to the count and nobs arguments, which contain the relevant data for the two samples.
So, our website wants to conduct an experiment. The website will show some of its visitors different versions of an advertisement created by a sponsor. Users are randomly assigned by the server to either Version A or Version B. The website will track how often Version A was clicked on and how often Version B was clicked on by its users. On a particular day, 516 visitors saw Version A and 510 saw Version B. 108 of those who saw Version A clicked on it, and 144 who saw Version B clicked on it. So, we want to know which ad generated more clicks.
We're going to be testing the following hypotheses:

Let's go ahead and import the numpy library. When we import NumPy, we're going to use NumPy arrays to contain our data, as follows:

We will then assign the arrays and define the alternative as two-sided, as follows:

We end up with a p value of around 0.0066, which is small in our case, so we reject the null hypothesis. It appears that the two ads do not have the same proportion of clicks. We have looked at hypothesis testing for proportions. We will now look at applying everything that we have learned to mean values.
- Spring 5.0 Microservices(Second Edition)
- Java程序設(shè)計與開發(fā)
- 自己動手寫搜索引擎
- JMeter 性能測試實戰(zhàn)(第2版)
- Access 2010數(shù)據(jù)庫基礎(chǔ)與應(yīng)用項目式教程(第3版)
- Web全棧工程師的自我修養(yǎng)
- concrete5 Cookbook
- Python完全自學(xué)教程
- 可解釋機(jī)器學(xué)習(xí):模型、方法與實踐
- 數(shù)據(jù)結(jié)構(gòu)案例教程(C/C++版)
- Mastering Android Development with Kotlin
- Scala編程實戰(zhàn)
- 高效使用Greenplum:入門、進(jìn)階與數(shù)據(jù)中臺
- Java語言程序設(shè)計實用教程(第2版)
- FORTRAN程序設(shè)計權(quán)威指南