In this blog, I will explain to you how the statistical analysis is being applied for two independent samples. In practice, the test statistic used for comparing the two means from a population is by using the t-test because t-test shrinks the data to a single t-value and it is then compared with the significant value for the final conclusion. Now, let us understand the theoretical background in performing the t-test for two variables.

Suppose X1 and X2 be the two independent random variables and let, be the sample with size n1 and n2 from a population with mean µ1, µ2 and variance σ12, σ22 respectively.

Understanding the Problem Statement
The primary or basic task in any statistical data analysis is to know or find out what the problem is and how the data is being measured.

Construction of Test Hypotheses
Once you understand the problem at hand, the next step is to frame an appropriate hypothesis to test for statistical significance; we call it as the null hypothesis and alternative hypothesis (Flandin & Friston, 2019).

Finding a Suitable Test Statistics
For finding the suitable statistic test, we need to find the distribution of the data. I will illustrate with simulated data for two campaigns using R software.

Calculation of test statistic
Once you got all the necessary values for the calculation, the next step is to apply it to the formula of statistics test as mentioned earlier. Here, I will illustrate using R.

Learn More @ Statistical Analysis Help | Data Analysis Services | Data Collection Services | Data Mining Services | Statistics Services Help

Conclusion of the Problem
As a final step, we compare the calculated t.value with the critical value. In order to find the critical value, we need to fix the significance level alpha. Usually, it is considered as 5% that means we can tolerate the probability of rejecting the null hypothesis by 5% or 0.05 level of significance. The next step is to check whether the null hypothesis is one-sided or two-sided for concluding the problem. If you are concerned about which campaign is higher or smaller then the null will be one-sided. However, in our case, it is a two-sided null hypothesis stating that the means of the campaigns are equal. An important note is that in a two-sided test the critical region is divided by half (5% is equally distributed in both sides from population mean).


Cressie, N. A. C., & Whitford, H. J. (1986). How to use the two-sample t‐test. Biometrical Journal, 28(2), 131–148. Retrieved from

Flandin, G., & Friston, K. J. (2019). Analysis of family‐wise error rates in statistical parametric mapping using random field theory. Human Brain Mapping, 40(7), 2052–2054. Retrieved from

Author's Bio: 

Why Statswork?
Plagiarism Free | Unlimited Support | Prompt Turnaround Times | Subject Matter Expertise | Experienced Bio-statisticians & Statisticians | Statistics Across Methodologies | Wide Range Of Tools & Technologies Supports | Tutoring Services | 24/7 Email Support | Recommended by Universities
Contact Us:



UnitedKingdom: +44-1143520021

India: +91-4448137070

WhatsApp: +91-8754446690