# Basic AB Testing with R

Suppose there is an email campaign for customers.

There are two equally divided groups A and B. B received an email with "Offer ends this Saturday. Use code B!". A did not receive the email.

How can I find the effect of the campaign? Which statistical method can be used for that?

Could not paste the complete data with dput() and hence uploaded .csv into here

+------------+--------------+------------+
| CustomerNo | Website View | Test Group |
+------------+--------------+------------+
|          1 |           88 | A          |
|          2 |           56 | B          |
|          3 |           80 | B          |
|          4 |           49 | A          |
|          5 |           61 | A          |
|          6 |           21 | B          |
|          7 |           48 | A          |
|          8 |           55 | A          |
|          9 |           42 | B          |
|         10 |           66 | B          |
+------------+--------------+------------+

• What is the "website view" variable?
– Dave
Aug 16 '19 at 12:31
• @Dave Number of homepage views by a customer during one week Aug 16 '19 at 13:07
• Now for what kind of effect do you want to test?
– Dave
Aug 16 '19 at 13:26
• @Dave I want to find out if an email campaign works to incentivise customers or users to be more active on the website. The goal is to determine the impact of the campaign with any statistical test for AB testing. Aug 16 '19 at 13:51
• The t-test that Kourabi suggested most likely is what you're after, as it checks for a shift in the average (mean) number of homepage views. However, I suggest considering if that is indeed what you want to test. Put in specific, quantitative terms what you want to investigate. There are a lot of ways for distributions to differ besides shifts in mean. For instance, the t-test and visual inspection suggest no change in mean, but there is a change is variability suggested by the plots! (It's going to be hard to prove that with such a small sample size, however.)
– Dave
Aug 16 '19 at 14:09

x <- as.factor( c( "A" , "B" , "B" , "A" , "A" , "B" , "A" , "A" , "B" , "B" ))