RAISINS
  • Home
  • Get Started!
    • Data Analysis
    • Analysis of Experiments
    • Non Parametric tests
    • Statistical Genetics
    • Social Sciences
    • Sample size Calculator
    • Econometrics
    • Custom Tools
  • Learn
    • Tutorials
    • Quick Videos
    • Trainings New
    • Webinars
    • Wine
  • Team
  • Resources
    • Citation Info
    • Discussion
  • Pricing Plans
  • New Training
  • Go to AI Mode
  • Feedback
  • Contact us

TABLE OF CONTENTS

  • 1 Analysis of experiments
  • 2 Preview mode and Quick Tour
  • 3 Two-Sample T-Test
  • 4 A working example
  • 5 How to prepare your data?
  • 6 TWO SAMPLE T -TEST ANALYSE TAB
  • 7 Transformation
  • 8 Analysis results
    • 8.1 Interpretation from Figure 6
  • 9 Normality test and plots
  • 10 Plots and Graphs
    • 10.1 Customizing plots
  • 11 AI interpretation
  • 12 Preparing your data
  • 13 Preparing data in MS Excel
  • 14 Creating dataset in RAISINS
  • 15 Model datasets
  • 16 FAQ’s
  • 17 View data

Two-Sample T-Test

1Statoberry LLP, 2Department of Agricultural Statistics, Kerala Agricultural University

ABSTRACT

The Two-Sample T-Test is one of the most widely used statistical procedures for comparing the means of two independent groups, enabling researchers to determine whether a statistically significant difference exists between them. By testing the null hypothesis that both group means are equal, the Two-Sample T-Test provides a rigorous framework for inference in biological, agricultural, clinical, and social science research. In RAISINS, this test can be performed effortlessly without writing a single line of code, making it accessible to researchers and students alike. This tutorial will guide you through the complete workflow — from data preparation and upload to result interpretation, normality assessment, and visualization — using RAISINS. You will obtain publication-ready tables and plots, formal normality testing (Shapiro–Wilk, Anderson–Darling, Lilliefors, and Jarque–Bera) with a Q–Q plot, and AI-assisted interpretation through the built-in RA-One assistant.

Hover or click each point to see more information.

Introduction Two-Sample T-Test
    The two-sample t-test, also known as the independent samples t-test, was formalized in the early 20th century through the foundational work of William Sealy Gosset, an English statistician who published under the pseudonym “Student” while working at the Guinness Brewery in Dublin. In 1908, Gosset developed the t-distribution to address the problem of making reliable statistical inferences from small samples a practical necessity in quality control and brewing experiments where large datasets were not feasible. His work laid the groundwork for what later became the Student’s t-test, subsequently extended and formalized by Ronald A. Fisher. The two-sample form of the test allows researchers to compare means from two independent groups, becoming a cornerstone method in agricultural trials, medical research, and the life sciences for over a century.

1 Analysis of experiments

To get started, visit RAISINS www.raisins.live home page and go to Analysis of experiments. Here, you can see different single-factor experimental designs and statistical tests. In this tutorial, we focus on the Two-Sample T-Test, as shown in Figure 1.

Figure 1: Analysis of experiment tab showing the Two-Sample T-Test option

2 Preview mode and Quick Tour

Before subscribing, you can explore the entire app using Preview mode, accessible from the Welcome page. Preview mode loads built-in datasets so you can try every feature — analysis, normality tests, plots, and the RA-One assistant — without uploading your own data. First-time users are also offered a Quick Tour, an interactive, step-by-step guided walkthrough that highlights each control and explains what it does. You can retake the tour at any time from the Quick Tour tab.

3 Two-Sample T-Test

A Two-Sample T-Test is a parametric statistical procedure used to determine whether the means of two independent groups differ significantly from each other. It is appropriate when you have one continuous response variable measured under two distinct, non-overlapping groups for example, comparing the yield of two crop varieties, the blood pressure of a treatment group versus a control, or the germination rate under two irrigation regimes. The test assumes that the observations within each group are independent, that the response variable is approximately normally distributed within each group, and that the variances of the two groups are either equal (Student’s t-test) or unequal (Welch’s t-test). When the normality assumption is violated, a non-parametric alternative such as the Mann–Whitney U test is more appropriate. RAISINS supports both unpaired (independent) and paired two-sample t-tests, and automatically runs both the Student’s t-test and Welch’s correction, alongside formal normality testing, so you can make an informed choice based on your data.

TipThe Two-Sample T-Test is a parametric statistical test used to compare the means of two independent groups and determine whether any observed difference is statistically significant or attributable to random chance.

4 A working example

This working example presents data for a two-sample t-test using two independent groups: Treatment and Control. Each column contains individual observations collected from the respective groups. The treatment group shows comparatively higher values than the control group, indicating a possible effect of the treatment. These data are used to compare the means of the two groups and determine whether the observed difference is statistically significant. The dataset can also be visualized using plots such as beeswarm plots, boxplots, or violin plots to better understand distribution, spread, and variability.

Figure 2: Example dataset for the Two-Sample T-Test

5 How to prepare your data?

Arranging data for uploading in RAISINS is very simple. Prepare your data exactly like the one shown in Figure 2, using a single-sheet Excel file. The first column should contain the group labels (e.g., “Drip_Irrigation” and “Flood_Irrigation”), and all response variables should follow in subsequent columns. Make sure no blank rows are left above the header, and all columns have proper names without spaces or special characters. That is it , your file is ready to upload. If you still have doubts, see Figure 3. To prepare your dataset for analysis in RAISINS, you have two options: creating your dataset in MS Excel, or building your dataset directly within the RAISINS app.

Figure 3: Illustrating how to create a dataset

6 TWO SAMPLE T -TEST ANALYSE TAB

In Figure 4, you can see the detailed view of the Analysis tab for the Two-Sample T-Test, along with explanations of what each option does. This section helps you understand the purpose of every setting, so you can select the most appropriate ones for your data and analysis. Upload the prepared file by clicking Browse in the sidebar of the Analysis tab. When the file is uploaded, options to select the Group column and response Variables will appear. Select the appropriate column under Groups and choose the variables you wish to analyse. You can also choose between a Paired and an Unpaired (independent) t-test depending on your experimental design. Once you click the Run Analysis button, all relevant results and outputs appear instantly across three sub-tabs — Analysis Results, Normality Test, and Plots & Graphs. On the Analysis Results panel you can further adjust the alternative hypothesis (two-tailed, or one-tailed with Mean 1 < Mean 2 or Mean 1 > Mean 2), the significance level (α), the number of decimal digits, and the font. For some data, when observed variables are not normally distributed, RAISINS provides a built-in transformation option (Section 7).

Figure 4: Two-Sample T-Test analysis window explained

7 Transformation

Log, square root, and arcsine transformations are often used in statistical analysis to make data more normal and reduce uneven variation. Researchers can apply these transformations when analysing data in RAISINS as shown in Figure 5.

Figure 5: Transformation options

Logarithmic transformation is a mathematical procedure used to convert a skewed distribution into a more symmetrical one by replacing each data point (x) with its logarithm. This technique is specifically applied to positive, continuous data where the variance is proportional to the mean, a relationship common in phenomena that exhibit multiplicative or exponential growth.

Square root transformation is a statistical method used to stabilize variance and reduce right-skewness by replacing each data point (x) with its square root. It is primarily applied to non-negative, discrete count data such as those following a Poisson distribution, where the variance of the data tends to increase in proportion to the mean. By compressing the upper end of the scale more significantly than the lower end, this transformation brings the data closer to a normal distribution, satisfying the homoscedasticity requirements of many parametric statistical tests.

Arcsine transformation (also known as the angular transformation) is a mathematical technique specifically designed for data expressed as proportions or percentages bounded between 0 and 1. By taking the inverse sine of the square root of the proportion, this transformation stretches the ends of the distribution near 0 and 1, where variance is naturally small. It is primarily used to achieve homoscedasticity in binomial data.

After choosing the appropriate transformation proceed to Section 8 for analysis.

8 Analysis results

Once your dataset is uploaded and you click Run Analysis, the Two-Sample T-Test will be performed. The test compares the means of the two groups and produces a t-statistic along with a p-value, enabling you to conclude whether the difference between the two group means is statistically significant. Results are presented as two key output tables, as described below.

Table 1: T-Test summary result

Figure 6: T-Test summary result showing t-statistic, degrees of freedom, and p-value
T-Test result table

In a Two-Sample T-Test, the null hypothesis states that the means of the two groups are equal (H₀: μ₁ = μ₂), and the alternative hypothesis states that they differ (H₁: μ₁ ≠ μ₂). The test statistic t is computed by dividing the difference between the two sample means by the standard error of that difference. Under the null hypothesis, this statistic follows a t-distribution with degrees of freedom determined either by the pooled method (when variances are equal) or by Welch’s approximation (when variances are unequal). The computed t-value is compared against a critical t-value at the chosen significance level (α = 0.05 or 0.01). If the absolute computed t-value exceeds the critical value, or equivalently if the p-value is less than α, the null hypothesis is rejected, indicating a statistically significant difference between the two group means.

Significance is indicated by an asterisk ( * ) for the 5% level and two asterisks ( ** ) for the 1% level of significance, displayed as superscripts in the table.

RAISINS automatically performs both the standard Student’s t-test (assuming equal variances) and Welch’s t-test (not assuming equal variances), and presents both results so you can choose based on the outcome of the variance equality test.

8.1 Interpretation from Figure 6

The T-Test result shows that for the variable Yield, the mean for Drip Irrigation (4521.60 kg/plot) is higher than the mean for Flood Irrigation (4102.40 kg/plot). The computed t-statistic is 3.47 with 28 degrees of freedom, and the associated p-value is 0.0017, which is significant at the 1% level. This provides strong evidence to reject the null hypothesis and conclude that Drip Irrigation and Flood Irrigation differ significantly in their effect on Yield. In practical terms, the difference in mean yield between the two irrigation methods is unlikely to have arisen by chance, and the choice of irrigation method has a meaningful influence on crop performance. For variables where the p-value exceeds 0.05, the null hypothesis cannot be rejected and the two group means are considered statistically similar.

Table 2: Group descriptive statistics and detailed t-test results

Overview of T-Test Results and Interpretation

  1. Groups and Response Variables

Groups: The two independent categories (e.g., Drip Irrigation and Flood Irrigation) whose means are being compared.

Response Variable: The dependent variable or specific measurement (e.g., Yield, Plant_Height) recorded to evaluate the performance of the two groups.

  1. Test Statistics

t-statistic: The computed test value that quantifies the standardized difference between the two group means relative to the variability in the data.

Degrees of Freedom (df): Determines the shape of the t-distribution used to compute the p-value. In the pooled case, df = n₁ + n₂ − 2; in Welch’s approximation, df is adjusted based on the sample variances.

p-value: The probability that the observed difference in means (or a larger difference) would arise by chance if the null hypothesis were true. A p-value below 0.05 is conventionally considered statistically significant.

  1. Group Descriptive Statistics

For each group, RAISINS reports the sample size (N), Mean, Standard Deviation (SD), the five-number summary (Minimum, Q1, Median, Q3, Maximum), and the Coefficient of Variation (CV %), giving a complete picture of the central tendency, spread, and relative variability within each group.

  1. Mean Difference, Confidence Interval, and Test Used

Mean difference: The difference between the two group means. The t-test table also reports the confidence interval for this difference (at the selected confidence level) and a Test Used column indicating whether Student’s or Welch’s t-test was applied, based on the F-test for equality of variances.

9 Normality test and plots

Why test for normality?
    The Two-Sample T-Test is a parametric test that assumes the response variable is approximately normally distributed within each group. When this assumption is violated particularly in small samples the t-test may produce unreliable p-values. Normality testing helps you decide whether the parametric t-test is appropriate, or whether a non-parametric alternative such as the Mann–Whitney U test should be used instead. For large samples (n > 30 per group), the Central Limit Theorem generally ensures that the sampling distribution of the mean is approximately normal even if the raw data are not, reducing the need for formal normality testing.

RAISINS performs four formal normality tests for each group alongside the Two-Sample T-Test: the Shapiro–Wilk test, the Anderson–Darling test, the Lilliefors (Kolmogorov–Smirnov) test, and the Jarque–Bera test. The Shapiro–Wilk test is the most widely used, as it is regarded as one of the most powerful tests for small to moderate sample sizes; its statistic W ranges from 0 to 1, where values close to 1 indicate normality. Across all four tests, a statistically significant result (p < 0.05) indicates a significant departure from normality and suggests that transformation or a non-parametric alternative may be warranted. A fully customisable Q–Q plot is also provided for each variable to visually assess normality (see Figure 7).

Figure 7: Shapiro-Wilk normality test result table for each group and variable
Normality test details

Shapiro–Wilk Test

The Shapiro–Wilk test evaluates whether a sample comes from a normally distributed population. It computes a test statistic W by comparing the observed data quantiles with the expected quantiles of a normal distribution. The null hypothesis of the test is that the data are normally distributed; a significant p-value (p < 0.05) leads to rejection of this null hypothesis. The Shapiro–Wilk test is most reliable for sample sizes between 3 and 50 and is considered more powerful than alternative tests such as Kolmogorov–Smirnov for small samples.

\[W = \frac{\left(\sum_{i=1}^{n} a_i x_{(i)}\right)^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}\]

where \(x_{(i)}\) are the order statistics (sorted values) and \(a_i\) are constants derived from the expected values of normal order statistics.

Anderson–Darling Test

A goodness-of-fit test that gives extra weight to the tails of the distribution, making it especially sensitive to departures from normality in the extremes.

Lilliefors (Kolmogorov–Smirnov) Test

An adaptation of the Kolmogorov–Smirnov test for the case where the mean and variance are estimated from the data. It compares the empirical cumulative distribution of the sample with that of a normal distribution.

Jarque–Bera Test

A test based on the sample skewness and kurtosis that assesses whether they match those expected under a normal distribution.

F-test for Equality of Variances

Before deciding whether to use the standard Student’s t-test or Welch’s t-test, RAISINS performs an F-test for equality of variances. If the p-value for the F-test is greater than 0.05, the variances of the two groups are considered equal and the pooled Student’s t-test is applied. If p < 0.05, the variances differ significantly and Welch’s t-test, which does not assume equal variances, is used automatically.

Which test to use based on normality?

The choice of the appropriate test depends on whether the normality assumption is satisfied. If both groups pass the normality tests (e.g. Shapiro–Wilk, p ≥ 0.05), the Two-Sample T-Test (Student’s or Welch’s, depending on variance equality) is appropriate. If one or both groups fail the normality tests, a logarithmic or square root transformation (Section 7) should first be attempted to normalise the data. If data remain non-normal after transformation, the Mann–Whitney U test (a non-parametric alternative) is recommended. In the working example, the Shapiro–Wilk test returned W = 0.967 (p = 0.412) for Drip Irrigation and W = 0.971 (p = 0.487) for Flood Irrigation for the Yield variable, confirming that the normality assumption is satisfied and the t-test results are valid.

10 Plots and Graphs

RAISINS is designed for a smooth and hassle-free experience. Once you click the Run Analysis button, all relevant results and outputs appear instantly leaving no room for confusion. We have ensured that every possible plot related to the Two-Sample T-Test is readily available. Simply click on the Plot and Graph tab to view them (see Figure 8). Each plot comes with a gear icon at the top-left corner, allowing you to customise its appearance. You can also download these plots in high-quality PNG format (300 dpi), JPEG, TIFF, PDF, and SVG for use in reports or presentations.

10.1 Customizing plots

RAISINS provides users with various customisation features for plots to enhance the visualisation according to the requirements of the user. Click on Figure 8 to get a clear idea of the customising features.

Figure 8: Plot settings for customizing Two-Sample T-Test plots

From Figure 9 to Figure 13, you can see the different types of plots available in RAISINS for the Two-Sample T-Test. Each one is visually illustrated and accompanied by a clear, insightful description, making it easy to understand the distribution and comparison of the two groups.

Figure 9: Box plot with t-Test

A Box plot with a t-test visually compares the distribution and median of two groups while the t-test statistically checks whether their mean difference is significant. The box plot displays spread, quartiles, and outliers, helping interpret group variation along with the t-test result.

Figure 10: Raincloud Plot

A Raincloud plot combines a violin plot, box plot, and scatter plot in a single visualization. It shows data distribution, median, spread, and individual observations together, making it useful for comparing groups and understanding variability clearly.

Figure 11: Beeswarm Plot

A Beeswarm plot in a two-sample t-test shows individual data points of two groups without overlap. It helps visualize group differences, spread, and outliers before comparing means statistically.

Figure 12: Strip Chart

A Strip chart with significance displays individual data points of different groups along with statistical significance indicators (such as p-values or asterisks). It helps visualize group distribution and identify whether differences between groups are statistically significant.

Figure 13: Half Eye Plot

A Half-eye plot combines a density plot with interval estimates and individual data summaries. It shows the distribution, central tendency, and uncertainty of data in a compact form, making it useful for comparing groups and statistical results visually.

11 AI interpretation

RAISINS is equipped with RA-One, an AI-powered RAISINS Assistant designed to help users comprehend the outcomes of the Two-Sample T-Test and associated analyses. Through a simple conversation, RA-One provides clear and concise summaries of results, identifies whether statistically significant differences exist between the two groups, explains the choice between Student’s and Welch’s t-test, and offers informed suggestions for potential next steps or further analyses. You can chat with the assistant from the dedicated RA-One tab or the floating chat bubble available throughout the app, as shown in Figure 14.

Figure 14: AI powered RAISINS Assistant to interpret your results

12 Preparing your data

“Your analysis is only as good as your data! Feed RAISINS high-quality data, and it will deliver powerful insights feed it messy data, and the results won’t be trustworthy.”

  1. Create your dataset in MS Excel

  2. Build your dataset directly within the RAISINS app

13 Preparing data in MS Excel

Open a new blank sheet in MS Excel with only one sheet included, and avoid adding any unnecessary content. The dataset should follow a column-based format, where the first column represents the group label the two independent groups being compared (e.g., “Drip_Irrigation” and “Flood_Irrigation”). All response variables under study (e.g., Yield, Plant_Height, Tillers, GrainWeight) should be arranged in separate columns, and each group label should be repeated according to the number of observations in that group. The file can be saved in CSV, XLS, or XLSX format, but CSV is recommended as it is lighter and enables faster loading. Ensure that there are no unwanted spaces in column names or group labels. For reference, see the structure shown in Figure 15. As illustrated in Figure 2, group labels must appear repeatedly according to the number of replicates per group, and the data can also be arranged as shown in Figure 16.

Figure 15: Model-1: showing how the prepared Excel file for upload should look like
Figure 16: Model-2: showing how the prepared Excel file for upload should look like
Dataset Creation Rules

1. Column Naming Convention - No spaces allowed in column names.
- Use underscores (_) or full stops (.) for separation. - Avoid symbols and special characters like %, # etc. 2. Data Arrangement - Start data arrangement towards the upper-left corner.
- Ensure the row above the data is not blank. 3. Cell Management - Avoid typing or deleting in cells without data.
- If needed, select affected cells, right-click, and select Clear Contents. 4. Column Relevance - Name all columns meaningfully.
- Exclude unnecessary columns not required for analysis. 5. Group Labels - The group column must contain exactly two distinct labels corresponding to the two groups being compared.
- Ensure consistent spelling and capitalisation of group labels throughout the column.

How to Save as CSV in MS Excel

1. Open Your Workbook

-   Ensure your data is arranged properly with only one sheet.
  1. Click ‘File’ Menu

    • Go to the top-left corner and click on File.
  2. Choose ‘Save As’ or ‘Save a Copy’

    • Select the location where you want to save your file.
  3. Set File Type to CSV

    • In the ‘Save as type’ dropdown menu, choose CSV (Comma delimited) (*.csv).
  4. Name Your File

    • Enter a relevant file name without spaces (use underscores if needed).
  5. Click ‘Save’

    • Click Save to export the file.

💡 Tip: Before saving, double-check that your data is on the first sheet and follows the required format (e.g., no empty rows above the data, meaningful column names, exactly two unique group labels in the group column).

14 Creating dataset in RAISINS

If you are unsure about the correct format for creating a dataset, do not worry RAISINS offers an option to create data directly within the app using the prescribed template. Here is how:

  • Navigate to the Create Data Tab

  • Select the number of Groups (set to 2 for a Two-Sample T-Test)

  • Select number of Replications per group

  • Select number of Characters (response variables)

  • Click on the Create button

The model layout will appear as shown in Figure 17. You may enter the observations manually into the CSV file once downloaded, or paste the observations straight into the file provided. Once you have entered the observations in the layout, download the CSV file and upload it in Analysis.

Figure 17: Creating dataset within RAISINS

15 Model datasets

To test the app or better understand the data arrangement, we provide model datasets within the app. You can download them from the Dataset tab.

Figure 18: Model dataset

16 FAQ’s

The app includes a dedicated FAQs section to help clarify common doubts and guide users through various features. This section provides detailed answers to frequently asked questions, offering additional information and helpful tips to ensure a smooth user experience. If you are ever unsure about how something works for example, which test to use when data are not normally distributed, or how to choose between Student’s and Welch’s t-test, the FAQs is a great place to start.

Figure 19: FAQs

17 View data

View Data serves as the primary diagnostic tool for ensuring data integrity before analysis. Upon uploading your dataset, the system performs an automated Health Check to validate column types and formatting. For the Two-Sample T-Test, this step is especially important to confirm that the group column contains exactly two unique labels, that all response variable columns contain numeric values, and that there are no missing or incorrectly formatted entries that could distort the test results.

View data

View data

Explore

  • Data analysis
  • Feedback

Policies

  • Privacy policy
  • Data policy
  • Refund policy

Contact

  • Contact us
  • Team
  • Statoberry LLP
Statoberry LLP
© 2026 Statoberry LLP. All rights reserved.
Making statistics sweet — www.raisins.live
RAISINS