Você está na página 1de 15

T Test (Student’s T-Test): Definition and

Examples
Contents:

 What is a T Test?
 The T Score
 T Values and P Values
 Calculating the T Test
 What is a Paired T Test (Paired Samples T Test)?

What is a T test?

The t-distribution, used for the t-test. Image: Carnegie Mellon.

The t test (also called Student’s T Test) compares two averages (means) and tells you
if they are different from each other. The t test also tells you how significant the
differences are; In other words it lets you know if those differences could have
happened by chance.
A very simple example: Let’s say you have a cold and you try a naturopathic remedy.
Your cold lasts a couple of days. The next time you have a cold, you buy an
over-the-counter pharmaceutical and the cold lasts a week. You survey your friends
and they all tell you that their colds were of a shorter duration (an average of 3 days)
when they took the homeopathic remedy. What you really want to know is, are these
results repeatable? A t test can tell you by comparing the means of the two groups and
letting you know the probability of those results happening by chance.

Another example: Student’s T-tests can be used in real life to compare means. For
example, a drug company may want to test a new cancer drug to find out if it
improves life expectancy. In an experiment, there’s always a control group (a group
who are given a placebo, or “sugar pill”). The control group may show an average life
expectancy of +5 years, while the group taking the new drug might have a life
expectancy of +6 years. It would seem that the drug might work. But it could be due to
a fluke. To test this, researchers would use a Student’s t-test to find out if the results
are repeatable for an entire population.

The T Score.
The t score is a ratio between the difference between two groups and the difference
within the groups. The larger the t score, the more difference there is between groups.
The smaller the t score, the more similarity there is between groups. A t score of 3
means that the groups are three times as different from each other as they are within
each other. When you run a t test, the bigger the t-value, the more likely it is that the
results are repeatable.

 A large t-score tells you that the groups are different.


 A small t-score tells you that the groups are similar.

T-Values and P-values

How big is “big enough”? Every t-value has a p-value to go with it. A p-value is
the probability that the results from your sample data occurred by chance. P-values
are from 0% to 100%. They are usually written as a decimal. For example, a p value of
5% is 0.05. Low p-values are good; They indicate your data did not occur by chance.
For example, a p-value of .01 means there is only a 1% probability that the results
from an experiment happened by chance. In most cases, a p-value of 0.05 (5%) is
accepted to mean the data is valid.

Calculating the Statistic / Test Types


There are three main types of t-test:

 An Independent Samples t-test compares the means for two groups.


 A Paired sample t-test compares means from the same group at different
times (say, one year apart).
 A One sample t-test tests the mean of a single group against a known mean.
You probably don’t want to calculate the test by hand (the math can get very messy,
but if you insist you can find the steps for an independent samples t test here.

Use the following tools to calculate the t test:


How to do a T test in Excel.
T test in SPSS.
T distribution on the TI 89.
T distribution on the TI 83.

What is a Paired T Test (Paired


Samples T Test / Dependent Samples T
Test)?
A paired t test (also called a correlated pairs t-test, a paired samples t
test or dependent samples t test) is where you run a t test on dependent samples.
Dependent samples are essentially connected — they are tests on the same person or
thing. For example:

 Knee MRI costs at two different hospitals,


 Two tests on the same person before and after training,
 Two blood pressure measurements on the same person using different
equipment.

When to Choose a Paired T Test /


Paired Samples T Test / Dependent
Samples T Test
Choose the paired t-test if you have two measurements on the same item, person or
thing. You should also choose this test if you have two items that are being measured
with a unique condition. For example, you might be measuring car safety performance
in Vehicle Research and Testing and subject the cars to a series of crash tests. Although
the manufacturers are different, you might be subjecting them to the same conditions.

With a “regular” two sample t test, you’re comparing the means for two
different samples. For example, you might test two different groups of customer
service associates on a business-related test or testing students from two universities on
their English skills. If you take a random sample each group separately and they have
different conditions, your samples are independent and you should run an independent
samples t test (also called between-samples and unpaired-samples).

The null hypothesis for the for the independent samples t-test is μ1 = μ2. In other
words, it assumes the means are equal. With the paired t test, the null hypothesis is
that the pairwise difference between the two tests is equal (H0: µd = 0). The difference
between the two tests is very subtle; which one you choose is based on your data
collection method.

Paired Samples T Test By hand


Sample question: Calculate a paired t test by hand for the following data:

Step 1: Subtract each Y score from each X score.


Step 2: Add up all of the values from Step 1.
Set this number aside for a moment.

Step 3: Square the differences from Step 1.

Step 4: Add up all of the squared differences from Step 3.

Step 5: Use the following formula to calculate the t-score:

ΣD: Sum of the differences (Sum of X-Y from Step 2)


ΣD2: Sum of the squared differences (from Step 4)
(ΣD)2: Sum of the differences (from Step 2), squared.

Step 6: Subtract 1 from the sample size to get the degrees of freedom. We have 11
items, so 11-1 = 10.

Step 7: Find the p-value in the t-table, using the degrees of freedom in Step 6. If you
don’t have a specified alpha level, use 0.05 (5%). For this sample problem, with df=10,
the t-value is 2.228.

Step 8: Compare your t-table value from Step 7 (2.228) to your calculated t-value
(-2.74). The calculated t-value is greater than the table value at an alpha level of .05.
The p-value is less than the alpha level: p <.05. We can reject the null hypothesis that
there is no difference between means.

Note: You can ignore the minus sign when comparing the two t-values, as ± indicates
the direction; the p-value remains the same for both directions.

Check out our YouTube channel for more stats help and tips!
Independent Samples T Test (Unpaired
Samples): Definition, Running
T-Distribution > Independent Samples T Test

The rejection regions in a two-tailed t-distribution. Image: ETSU.edu

Contents:

 What is an Independent Samples T Test?


 Assumptions for the Independent Samples T Test
 How to Run an Independent Samples T Test (Excel/SPSS)
 How to Calculate an Independent Samples T Test by Hand

What is an Independent Samples T


Test?
The independent samples t test (also called the unpaired samples t test) is the most
common form of the T test. It helps you to compare the means of two sets of data.
For example, you could run a t test to see if the average test scores of males and
females are different; the test answers the question, “Could these differences have
occurred by random chance?” The two other types of t test are:

 One sample t test: used to compare a result to an expected value. For example,
do males score higher than the average of 70 on a test if their exam time is
switched to 8 a.m.?
 Paired t test (dependent samples): used to compare related observations. For
example, do test scores differ significantly if the test is taken at 8 a.m. or noon?
This test is extremely useful because for the z test you need to know facts about the
population, like the population standard deviation. With the independent samples t
test, you don’t need to know this information. You should use this test when:

 You do not know the population mean or standard deviation.


 You have two independent, separate samples.

Assumptions for the Independent


Samples T Test
 Assumption of Independence: you need two independent, categorical groups
that represent your independent variable. In the above example of test scores
“males” or “females” would be your independent variable.
 Assumption of normality: the dependent variable should be approximately
normally distributed. The dependent variable should also be measured on a
continuous scale. In the above example on average test scores, the “test score”
would be the dependent variable.
 Assumption of Homogeneity of Variance: The variances of the dependent
variable should be equal.

How to Run an Independent Samples T


Test
Technology is usually used to run this test. For Excel instructions, see: How to run a T
Test in Excel. For instructions by hand, scroll down.
Back to top

How to Run an Independent Samples T


Test in SPSS
Before you perform a t test in SPSS for independent samples, you should:

1. Write a hypothesis statement. For the above research question, the null
hypothesis would be that there is no significant difference
2. Determine if your test is one-tailed or two-tailed
3. Specify an alpha level.
Watch the video or read the steps below:
Step 1: Open the worksheet with the data you want to perform the t test in SPSS.

Step 2: Define the SPSS variables you want to perform a t-test on. For example, you
might want to compare GPAs between male and female high school students. Therefore,
you’ll want to define the variables “sex” (i.e. other male or female). If you aren’t sure
how to define variables in SPSS, click here to find out how.

Step 3: Click “Analyze,” then click “Compare Means,” then click “Independent Sample
T Test.”

Step 4: Select the dependent variable from the left window pane and then click the top
arrow button to move the variables over to the Test Variable(s): window. For this
example, we are comparing GPAs, so the test variable we want to select is GPA.

Step 5: Select the independent variable in the left window and then click the arrow to
the left of the “Grouping Variable” box. The grouping variable is the variable you
divided into groups when you defined variables. For this example, the groups are
“male” and “female” so the grouping variable you want to select is “Sex.”

Step 6: Click “Define Groups.” For this example, type “1” into the Group 1 box (for
female) and then type “2” into the Group 2 box (for male).

Step 7: Click “Continue” and then click “OK.” The test is calculated and the results will
appear in a new window.

T Test in SPSS: Output


Your output will include:

 The Levine’s test for equal variance (the first section of the Independent
Samples Test box). If the significance level is larger than .05, you should use the
first line in the output table, Equal variances assumed. If the value is .05 or lower,
use the second row of results.
 Sig (2 Tailed): use the value indicated in Levine’s test. If this p-value is
above .05, then there is not a significant difference in test scores.
Tip: Click “Options” on the t-test window to change the confidence interval.

Check out out YouTube Channel for more SPSS videos!


Back to top

Calculating an Independent Samples T


Test By hand
Sample question: Calculate an independent samples t test for the following data sets:
Data set A: 1,2,2,3,3,4,4,5,5,6
Data set B: 1,2,4,5,5,5,6,6,7,9

Step 1: Sum the two groups:


A: 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 = 35
B: 1 + 2 + 4 + 5 + 5 + 5 + 6 + 6 + 7 + 9 = 50

Step 2: Square the sums from Step 1:


352 = 1225
492 = 2500
Set these numbers aside for a moment.

Step 3: Calculate the means for the two groups:


A: (1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6)/10 = 35/10 = 3.5
B: (1 + 2 + 4 + 5 + 5 + 5 + 6 + 6 + 7 + 9) = 50/10 = 5
Set these numbers aside for a moment.

Step 4: Square the individual scores and then add them up:
A: 11 + 22 + 22 + 33 + 33 + 44 + 44 + 55 + 55 + 66 = 145
B: 12 + 22 + 44 + 55 + 55 + 55 + 66 + 66 + 77 + 99 = 298
Set these numbers aside for a moment.
Step 5: Insert your numbers into the following formula and solve:

(ΣA)2: Sum of data set A, squared (Step 2).


(ΣB)2: Sum of data set B, squared (Step 2).
μA: Mean of data set A (Step 3)
μB: Mean of data set B (Step 3)
ΣA2: Sum of the squares of data set A (Step 4)
ΣB2: Sum of the squares of data set B (Step 4)
nA: Number of items in data set A
nB: Number of items in data set B
Step 6: Find the Degrees of freedom (nA-1 + nB-1) = 18

Step 7: Look up your degrees of freedom (Step 6) in the t-table. If you don’t know
what your alpha level is, use 5% (0.05).
18 degrees of freedom at an alpha level of 0.05 = 2.10.

Step 8: Compare your calculated value (Step 5) to your table value (Step 7). The
calculated value of -1.79 is less than the cutoff of 2.10 from the table. Therefore
p > .05. As the p-value is greater than the alpha level, we cannot conclude that there
is a difference between means.

One Sample T Test: How to Run It, Step by


Step
Hypothesis Testing > One Sample T Test

The one sample t test compares the mean of your sample data to a known value. For
example, you might want to know how your sample mean compares to the population
mean. You should run a one sample t test when you don’t know the
population standard deviation or you have a small sample size. For a full rundown on
which test to use, see: T-score vs. Z-Score.

Assumptions of the test (your data should meet these requirements for the test to be
valid):

 Data is independent.
 Data is collected randomly.
 The data is approximately normally distributed.

One Sample T Test Example


Sample question: your company wants to improve sales. Past sales data indicate that
the average sale was $100 per transaction. After training your sales force, recent sales
data (taken from a sample of 25 salesmen) indicates an average sale of $130, with a
standard deviation of $15. Did the training work? Test your hypothesis at a 5% alpha
level.

Step 1: Write your null hypothesis statement (How to state a null hypothesis). The
accepted hypothesis is that there is no difference in sales, so:
H0: μ = $100.

Step 2: Write your alternate hypothesis. This is the one you’re testing. You think that
there is a difference (that the mean sales increased), so:
H1: μ > $100.

Step 3: Identify the following pieces of information you’ll need to calculate the test
statistic. The question should give you these items:

1. The sample mean(x̄). This is given in the question as $130.


2. The population mean(μ). Given as $100 (from past data).
3. The sample standard deviation(s) = $15.
4. Number of observations(n) = 25.
Step 4: Insert the items from above into the t score formula.
t = (130 – 100) / ((15 / √(25))
t = (30 / 3) = 10
This is your calculated t-value.

Step 5: Find the t-table value. You need two values to find this:

1. The alpha level: given as 5% in the question.


2. The degrees of freedom, which is the number of items in the sample (n) minus
1: 25 – 1 = 24.
Look up 24 degrees of freedom in the left column and 0.05 in the top row. The
intersection is 1.711.This is your one-tailed critical t-value.

What this critical value means is that we would expect most values to fall under 1.711.
If our calculated t-value (from Step 4) falls within this range, the null hypothesis is
likely true.

Step 5: Compare Step 4 to Step 5. The value from Step 4 does not fall into the range
calculated in Step 5, so we can reject the null hypothesis. The value of 10 falls into the
rejection region (the left tail).

In other words, it’s highly likely that the mean sale is greater. The sales training was
probably a success.

Want to check your work? Take a look at Daniel Soper’s calculator. Just plug in your
data to get the t-statistic and critical values.

Você também pode gostar