0% found this document useful (0 votes)
6 views

Lecture 9_t-test

The document provides an overview of the t-test, a statistical test used to compare the means of two groups, including its types (one-sample, paired, and two-sample), hypotheses, assumptions, and interpretation of results. It details the necessary conditions for conducting t-tests, such as data independence, normal distribution, and homogeneity of variance. Additionally, it discusses the importance of reporting effect sizes and p-values to determine statistical significance.

Uploaded by

amtullahhadia02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lecture 9_t-test

The document provides an overview of the t-test, a statistical test used to compare the means of two groups, including its types (one-sample, paired, and two-sample), hypotheses, assumptions, and interpretation of results. It details the necessary conditions for conducting t-tests, such as data independence, normal distribution, and homogeneity of variance. Additionally, it discusses the importance of reporting effect sizes and p-values to determine statistical significance.

Uploaded by

amtullahhadia02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

t-test

Measuring Mean Differences

Instructor: Fatima Zafar


t- Test
• A t test is a statistical test that is used to compare the means of two
groups.
• It is often used in hypothesis testing to determine whether a process
or treatment actually has an effect on the population of interest, or
whether two groups are different from one another.
• A t-test may be used to evaluate whether a single group differs from a
known value (a one-sample t-test), whether two groups differ from
each other (an independent two-sample t-test), or whether there is a
significant difference in paired measurements (a paired, or dependent
samples t-test).
t- test hypothesis
• The null hypothesis (H0) is that the true difference between two group
means is zero.
• The alternate hypothesis (Ha) is that the true difference is different
from zero.
NOTE
• A t test can only be used when comparing the means of two groups. If
you want to compare more than two groups, or if you want to do
multiple pairwise comparisons, use an ANOVA test or a post-hoc test.
Assumptions of t-test
• The t test is a parametric test of difference, meaning that it makes the
same assumptions about your data as other parametric tests.
The t test assumes your data:
• are independent
• are (approximately) normally distributed
• homogeneity of variance: have a similar amount of variance within each
group being compared
• If your data do not fit these assumptions, you can try
a nonparametric alternative to the t test, such as the Wilcoxon Signed-
Rank test for data with unequal variances.
Variable type
• Independent variable: Categorical with two categories
• Dependent variable: Continuous (interval or ratio level)
TYPES OF t-TEST
• When choosing a t test, you will need to consider two things: whether
the groups being compared come from a single population or two
different populations, and whether you want to test the difference in
a specific direction.
Types of t-tests
One-sample t-test Paired t-test
Two-sample t-test

•Independent groups t-test


•Independent samples t-test
Synonyms Student’s t-test •Paired groups t-test
•Equal variances t-test
•Dependent samples t-test
•Pooled t-test
•Unequal variances t-test
Number of variables One Two Two
•Continuous measurement •Continuous measurement
Type of variable •Continuous measurement •Categorical or Nominal to define •Categorical or Nominal to define
groups pairing within group

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

Mean difference in heart rate for a group of


Mean heart rate of a group of people is equal Mean heart rates for two groups of people
Example: test if... people before and after exercise is zero or
to 65 or not are the same or not
not
Sample average of the differences in paired
Estimate of population mean Sample average Sample average for each group
measurements

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:

• The dependent variable must be continuous (interval/ratio).


• Independent variable should consist of two categorical, "related
groups" or "matched pairs". "Related groups" indicates that the same
subjects are present in both groups. The reason that it is possible to
have the same subjects in each group is because each subject has been
measured on two occasions on the same dependent variable.
• The dependent variable should be approximately normally
distributed.
• The dependent variable should not contain any outliers.
1. Before-and-after observations on the same subjects (e.g. students’
diagnostic test results before and after a particular module or
course).
2. Two different methods of measurement or two different
treatments where subjects are same (e.g. blood pressure
measurements using a manual or digital apparatus).
3. A paired or matched group (e.g. marital satisfaction among husband
and wife or studies on twins)
For example
• For example, you could use a paired sample t-test to understand
whether there was a difference in smokers' daily cigarette
consumption before and after a 6 week hypnotherapy programme
(i.e., your dependent variable would be "daily cigarette consumption",
and your two related groups would be the cigarette consumption
values "before" and "after" the hypnotherapy programme).
One sample t-test
• Assumption #1: Your dependent variable should be measured at
the interval or ratio level (i.e., continuous).
• Assumption #2: The data are independent (i.e., not
correlated/related), which means that there is no relationship
between the observations.
• Assumption #3: There should be no significant outliers. Outliers are
data points within your data that do not follow the usual pattern
• Assumption #4: Your dependent variable should be approximately
normally distributed.
For example
• A researcher is planning a psychological intervention study, but before he
proceeds he wants to characterize his participants' depression levels. He
tests each participant on a particular depression index, where anyone who
achieves a score of 4.0 is deemed to have 'normal' levels of depression.
Lower scores indicate less depression and higher scores indicate greater
depression.
• He has recruited 40 participants to take part in the study. Depression scores
are recorded. He wants to know whether his sample is representative of the
normal population (i.e., do the score statistically significantly differently from
4.0).
• For a one-sample t-test, there will only be one variable's data to be entered
into SPSS Statistics: the dependent variable

You might also like