# t-test for non normal distribution

I would like to run the following experiment , test if there is a significant difference between 2 algorithm ,the KPI I would like to test the difference for is : revenue per single impression.

My problem that in both experiments (the test and the control) , only 1% of the impressions reports for revenue, so the results of the experiments are not normally distributed. (my sample size is big : ±700M impressions for a given experiment, test 7 control)

Can I run a t-test to compare between the 2 algorithms ? based on the assumption that the diff between any 2 impressions (test vs control) is normally distributed ? should I check this assumption first ?

• I got a couple of questions: is the revenue value continous or binary (yes/no)? Are the impressions in two groups the same objects, so you can make a pair-wise comparison? Commented Sep 26, 2017 at 13:29
• is the revenue value continuous or binary --> answer : continuous Commented Sep 26, 2017 at 13:37
• Are the impressions in two groups the same objects, so you can make a pair-wise comparison? -- > Answer : not sure what do you mean by "same object" , both the control and the test have 700M impressions (the experiments have the same sample size) and the impressions where collected at the same time , meaning if in time = t0 1 impression went to the control also another impression will go to the tested experiment Commented Sep 26, 2017 at 13:40
• OK, so I assume you do not have paired samples, since I read your words as having different impressions in control and test groups. As David Ernst replied to you, you ought not care about the normality of the delta between random variables in both groups. What you have to care about is the normality of sampled Mean Statistic, which should be Gaussian for large samples (like yours) due to the Central Limit Theorem. You can run t-test, and for a double check run Mann-Whitney U test (aka Wilcoxon test) which is robust against non normality. Commented Sep 26, 2017 at 14:03

You don't need your sample points to be normally distributed if your sample is big enough. 30 serves as a rule of thumb. You have 1% of 700M in each group, thus twice 7M. No worries there.

As you don't have paired data on the user level, you certainly don't need to reason in terms of distribution of the difference of observations. You cannot compute such a difference anyway.

If the revenue is always the same amount for a clicking user, which you imply is not the case, then you would not compare on a per user basis but daily conversion rates. In this case you could compare daily conversion rates of both groups and pair the daily observations for better statistical power. But if you have data on a per user level for varying revenue, then don't do this.

There are other assumptions to t-tests. Equality of variances between both groups is necessary especially when the sizes of both groups are very different. But this can be dealt with by simply using Welch's version of the t-test. (Don't do Levene tests etc. just go with Welch and don't worry about variances.)

You also need i.i.d samples. Verify that your millions of sample points are independent and not some form of pseudo-replication. As you seem to be talking about individual website users, you are less likely to have pseudo replication. There can still be some if you have very many impressions per human user. If your users go onto the website many times, they will conceivably be much less likely to generate you advertising revenue when coming the 25th time in a short interval compared to the first time. Even more so if some visitors are bots and other crawlers. But as only those who click constitute your sample points, this should mitigate this problem. Have some precautions that your clicking impressions are not generated by bots and it should be fine.

Report not only p-values of the t-test but confidence intervals. P-values will almost certainly be super significant with such a large $n$, but that doesn't mean the effect is practically big enough to care about. A confidence interval tells you if your effect is big enough to care about. Because of your enormous $n$, I would do 99.9% confidence intervals, they should still be narrow.

Another problem you may need to deal with is the fact that only 1% report revenue per impression. Are you sure those 1% are representative of the remaining 99%. There will most likely be systematic effects that account for which cases are likely to be the 1%, thus systematic differences between your sample and your population (if you define your population to generalize onto like this).

Since in your case you have in both groups only 1% that clicks, it may be save to assume that in both groups the reasons for clicking or not clicking are the same. So you can compare the clickers to the other clickers. Just don't extrapolate from clickers to non clickers.