# t-Test Calculator

Dataset set x
comma separated input values
Dataset set y
comma separated input values
Mean 1  =  18.6
Mean 2  =  14.6
SD 1  =  12.5419
SD 2  =  9.1815
T-score  =  0.5754
GENERATE WORK

## t-Test - work with steps

Input Data :
Data set x = 3, 11, 17, 28, 34
Data set y = 5, 8, 13, 19, 28
Total number of elements = 5

Objective :
Find the t-score by using mean and standard deviation.

Solution :
Mean 1 = (3 + 11 + 17 + 28 + 34)/5
= 93/5
Mean 1 = 18.6

Mean 2 = (5 + 8 + 13 + 19 + 28)/5
= 73/5
Mean 2 = 14.6

SD1 = √(1/5 - 1) x ((3 - 18.6)2 + ( 11 - 18.6)2 + ( 17 - 18.6)2 + ( 28 - 18.6)2 + ( 34 - 18.6)2)
= √(1/4) x ((-15.6)2 + (-7.6)2 + (-1.6)2 + (9.4)2 + (15.4)2)
= √(0.25) x ((243.36) + (57.76) + (2.56) + (88.36) + (237.16))
= √(0.25) x 629.2
= √157.3
SD1 = 12.5419

SD2 = √(1/5 - 1) x ((5 - 14.6)2 + ( 8 - 14.6)2 + ( 13 - 14.6)2 + ( 19 - 14.6)2 + ( 28 - 14.6)2)
= √(1/4) x ((-9.6)2 + (-6.6)2 + (-1.6)2 + (4.4)2 + (13.4)2)
= √(0.25) x ((92.16) + (43.56) + (2.56) + (19.36) + (179.56))
= √(0.25) x 337.2
= √84.3
SD2 = 9.1815

t-score = x1 - x2√(SD12/n1 + SD22/n2)
= 18.6 - 14.6√((12.5419)2/5 + (9.1815)2/5)
= 4√((157.3)/5 + (84.3)/5)
= 4√(31.46 + 16.86)
= 4√(48.32)
= 46.9513
t-score = 0.5754

t-test calculator is an online statistics tool to estimate the significance of observed differences between the means of two samples when there is a null hypothesis that is no significant difference between the means by using standard deviation.
It is necessary to follow the next steps:

1. Enter two samples (observed values) in the box. These values must be real numbers or variables and may be separated by commas. The values can be copied from a text document or a spreadsheet.
2. Press the "GENERATE WORK" button to make the computation.
3. t-Test calculator will give a test whether samples from two independent populations provide that the populations have different means.
Input :Two lists of real numbers or a list of variables separated by comma;
Output : A real number or a variable.

t-Test Formula :
For a hypothesis test that has null hypothesis $H_0 : \mu_1 = \mu_2$, the value of the test statistic is determined by the formula $$t=\frac{\bar X_1-\bar X_2}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}$$ where $\bar X_1$ and $\bar X_2$ are sample means, $s_1$ and $s_2$ are sample standard deviations and $n_1$ and $n_2$ are sizes of samples $X_1$ and $X_2$, respectively.

## What is t-Test?

A hypothesis test consists of two hypotheses, the null hypothesis and the alternative hypothesis or research hypothesis.
The symbol $H_0$ represents the null hypothesis. The null hypothesis reflects that there will be no observed effect on the experiment. The null hypothesis consists of an equal sign. The alternative hypothesis reflects that there is an observed effect on the experiment. The symbol $H_a$ represents the alternative hypothesis. The first step in testing is to determine the null hypothesis and the alternative hypothesis. Regarding the testing hypothesis, there are some important terms. Rejection region is the set of values leads to rejection of the null hypothesis. Non-rejection region is the set of values that leads to nonrejection of the null hypothesis. Critical values are the value that separates the rejection and non-rejection regions.

The t-Test is used in comparing the means of two populations. There are two approaches:

• When the samples from the two populations are independent;
• When the samples from the two populations are depended, i.e. when they are paired.
If we have the independent samples, each possible pair of samples is equally likely to be the pair of samples selected. Suppose that $X$ is a normally distributed variable on each of two populations. So, for independent samples of sizes $n_1$ and $n_2$ from these populations, the mean of all possible differences between the two sample means is the difference between the two population means, i.e. $$\mu_{\bar X_1-\bar X_2}=\mu_1-\mu_2$$ The standard deviation between the two sample standard deviations is determined by the formula $$\sigma_{\bar X_1-\bar X_2}=\sqrt{\frac{\sigma^2_1}{n_1}+\frac{\sigma^2_2}{n_2}}$$ where $\bar X_1-\bar X_2$ is normally distributed.
The variable $$z=\frac{(\bar X_1-\bar X_2)-(\mu_1-\mu_2)}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}$$ has the standard normal distribution, where $\sigma_1$ and $\sigma_2$ are the population standard deviations. We distinguish two cases:
• If populations standard deviations are equal, $\sigma_1-\sigma_2$
The pooled sample standard deviation is determined by the formula
$$s_p=\sqrt{\frac{(n_1-1)s_1+(n_2-1)s_2}{n_1+n_2-2}}$$
where $s_1$ and $s_2$ are sample standard deviations, respectively.
If $X$ is a normally distributed variable then for independent samples of sizes $n_1$ and $n_2$ from the two populations, the variable $$t=\frac{(\bar X_1-\bar X_2)-(\mu_1-\mu_2)}{s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}$$ has the t-distribution with $df = n_1 + n_2 - 2$. For a hypothesis test that has null hypothesis $H_0 : \mu_1 = \mu_2$, we can use the variable $$t=\frac{\bar X_1-\bar X_2}{s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}$$
• If populations standard deviations are different
If $X$ is a normally distributed variable on both populations. For independent samples of sizes $n_1$ and $n_2$ from the two populations, the variable $$t=\frac{(\bar X_1-\bar X_2)-(\mu_1-\mu_2)}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}$$ has approximately a t-distribution. The degrees of freedom is determined by the formula $$\Delta=\frac{\Big[\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}\Big]^2}{\frac{\Big(\frac{\sigma_1^2}{n_1}\Big)^2}{n_1-1}+\frac{\Big(\frac{\sigma_2^2}{n_2}\Big)^2}{n_2-1}}$$ For a hypothesis test that has null hypothesis $H_0 : \mu_1 = \mu_2$, we use the variable $$t=\frac{(\bar X_1-\bar X_2)}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}$$ To obtain the critical values or P-value we use the t-table. This hypothesis-testing procedure is called the non-pooled t-test. The t-table is available in one-tail and two-tails formats.

### How to Find t-Critical Value

To perform a hypothesis test to compare two population means, $\mu_1$ and $\mu_2$, we have some assumptions:

• Simple and independent random samples;
• Normal populations or large samples.
The null hypothesis is $H_0: \mu_1 = \mu_2$. The critical value of the test statistic is determined by the formula $$t=\frac{(\bar X_1-\bar X_2)}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}$$ The work with steps shows the complete step-by-step calculation for how to find t-test value according to the given two data set $X_1:3,11,17,28,34$ and $X_2:5,8,13,19,28$ by using mean and standard deviation. For any other samples, just supply two lists of real numbers or variables and click on the "GENERATE WORK" button. The grade school students may use this t-test calculator to generate the work, verify the results derived by hand or do their homework problems efficiently.

### t-Test with Mean and Standard Deviation

A t-Test is one of the most frequently used tests in statistics. A t-Test is useful to conclude if the results are correct and applicable to the entire population. If we want to analyze simple experiments or when making simple comparisons between levels of independent variable we use the t-Test. It's used in comparison between two separate groups of individuals, for example: male vs female, experimental vs control group, etc.
Practice Problem 1:
There are two company A and B. We want to test average age of employees at these companies so we use a random sample of employee ages from each company.

 Company A Company B Mean 43.2 36.7 Standard Deviation 7 8.3 Number of Employess 50 66
We want to use these results to test $H_0: \mu_A=\mu_B$ versus $H_a: \mu_A>\mu_B$. Find the test statistic for this test.

Practice Problem 2:
We wanted to compare the average annual earnings of math professors between the two countries, Serbia and United States. We obtained earnings for a random sample of people from each country represented in thousands of US dollars
 Serbia United States Mean 43.2 5.2 Standard Deviation 1.2 8.3 Number of Employess 67 166
We want to use these results to test $H_0: \mu_1=\mu_2$ versus $H_a: \mu_1\ne\mu_2$. Find the test statistic for this test.

The t-test calculator, work with steps, formula and practice problems would be very useful for grade school students (K-12 education) to learn what is appropriate test statistic for t-Test, how to find it. With this statistics and probability tool, we can effortlessly make student's t-distribution calculation for given data sets. This concept can be applied in many real-life situation to test a hypothesis.