Lecture 9_t-test
Lecture 9_t-test
Decide if the population mean is equal to a Decide if the population means for two Decide if the difference between paired
Purpose of test
specific value or not different groups are equal or not measurements for a population is zero or not
Unknown, use sample standard deviations for Unknown, use sample standard deviation of
Population standard deviation Unknown, use sample standard deviation
each group differences in paired measurements
Number of observations in sample minus 1, Sum of observations in each sample minus 2, Number of paired observations in sample
Degrees of freedom or: or: minus 1, or:
n–1 n1 + n2 – 2 n–1
One-sample, two-sample, or
paired t test?
• If the groups come from a single population (e.g., measuring before
and after an experimental treatment), perform a paired t test. This is
a within-subjects design.
• If the groups come from two different populations (e.g., two different
species, or people from two separate cities), perform a two-
sample t test (independent t test). This is a between-subjects design.
• If there is one group being compared against a standard value (e.g.,
comparing the acidity of a liquid to a neutral pH of 7), perform a one-
sample t test.
t test function in statistical
software
• Most statistical software (R, SPSS, etc.) includes a t test function. This
built-in function will take your raw data and calculate the t value.
• It will then compare it to the critical value, and calculate a p-value.
This way you can quickly see whether your groups are statistically
different.
Interpretation
• When reporting your t test results, the most important values to
include are the t value, the p value, and the degrees of freedom for
the test. These will communicate to your audience whether the
difference between the two groups is statistically significant (that it is
unlikely to have happened by chance).
• You can also include the summary statistics for the groups being
compared, namely the mean and standard deviation.
p value
• Every t-value has a p-value to go with it.
• A p-value from a t test is the probability that the results from
your sample data occurred by chance.
• p-values are from 0% to 100% and are usually written as a decimal
(for example, a p value of 5% is 0.05).
• Low p-values 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.
• If p value is less than 0.05 that means the difference between groups
is statistically significant
The t Score
• The t score is a ratio between the difference between two groups
and the difference within the groups.
• Larger t scores = more difference between groups.
• Smaller t score = more similarity between groups.
Degree of freedom
• The degrees of freedom represent the number of values in a
statistical calculation that are free to vary.
• the degrees of freedom formula for a 1-sample t test equals N – 1
because you’re estimating one parameter, the mean. To calculate
degrees of freedom for a 2-sample t-test, use N – 2 because there are
now two parameters to estimate.
Effect size (Cohen’s D)
• It is also worth noting that in addition to reporting the results from
your assumptions and independent t-test, you are increasingly
expected to report effect sizes.
• Effect sizes are important because whilst the independent t-test tells
you whether differences between group means are "real" (i.e.,
different in the population), it does not tell you the "size" of the
difference.
• A commonly used interpretation is to refer to effect sizes as small (d =
0.2), medium (d = 0.5), and large (d = 0.8) based on benchmarks
suggested by Cohen (1988).
Cohen’s d
Cohen’s d calculator
Output
How To Interpret Results
Step 1:
• If Levene’s test is significant then this means equal variances not assumed
• If Levene’s test is non-significant then this means equal variances assumed
• After that we look for t value and p value
Step 2:
• If p value is significant then this means there are significant differences between
two groups
Step 3:
• t-value
• If t-value sign is negative then this means group 2 has higher mean than group 1
• If t-value sign is positive then this means group 1 has higher mean than group 2
Assumptions Of Independent
Sample T Test
• Assumption #1: Your dependent variable should be measured on a continuous scale (i.e., it is
measured at the interval or ratio level). Examples of variables that meet this criterion include
revision time (measured in hours), intelligence (measured using IQ score), exam performance
(measured from 0 to 100), weight (measured in kg), and so forth.
• Assumption #2: Your independent variable should consist of two categorical, independent
groups. Example independent variables that meet this criterion include gender (2 groups: male
or female), employment status (2 groups: employed or unemployed), smoker (2 groups: yes or
no), and so forth.
• Assumption #3: You should have independence of observations, which means that there is no
relationship between the observations in each group or between the groups themselves. For
example, there must be different participants in each group with no participant being in more
than one group. This is more of a study design issue than something you can test for, but it is
an important assumption of the independent t-test. If your study fails this assumption, you will
need to use another statistical test instead of the independent t-test (e.g., a paired-samples t-
test
Cont..
• Assumption #4: There should be no significant outliers. Outliers are simply single data points
within your data that do not follow the usual pattern (e.g., in a study of 100 students' IQ
scores, where the mean score was 108 with only a small variation between students, one
student had a score of 156, which is very unusual, and may even put her in the top 1% of IQ
scores globally). The problem with outliers is that they can have a negative effect on the
independent t-test, reducing the validity of your results. Fortunately, when using SPSS Statistics
to run an independent t-test on your data, you can easily detect possible outliers.
• Assumption #5: Your dependent variable should be approximately normally distributed for
each group of the independent variable. We talk about the independent t-test only
requiring approximately normal data because it is quite "robust" to violations of normality,
meaning that this assumption can be a little violated and still provide valid results. You can test
for normality using the Shapiro-Wilk test of normality, which is easily tested for using SPSS
Statistics.
• Assumption #6: There needs to be homogeneity of variances. You can test this assumption in
SPSS Statistics using Levene’s test for homogeneity of variances.
For example
• A researcher decided to investigate whether an exercise or weight
loss intervention is more effective in lowering cholesterol levels. To
this end, the researcher recruited a random sample of inactive males
that were classified as overweight. This sample was then randomly
split into two groups: Group 1 underwent a calorie-controlled diet and
Group 2 undertook the exercise-training programme. In order to
determine which treatment programme was more effective, the mean
cholesterol concentrations were compared between the two groups
at the end of the treatment programmes.
Assumptions of Paired Sample t
test
The paired sample t-test has four main assumptions: