0% found this document useful (0 votes)
4 views43 pages

Hypothesis Testing in Statistics

This document outlines a workshop on hypothesis testing as part of the UCL Faculty of Medical Sciences curriculum. It covers key concepts such as statistical significance, types of errors, statistical power, and various statistical methods including t-tests and ANOVA. The workshop aims to equip participants with the skills to apply statistical tests, evaluate results, and understand the implications of their findings.
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)
4 views43 pages

Hypothesis Testing in Statistics

This document outlines a workshop on hypothesis testing as part of the UCL Faculty of Medical Sciences curriculum. It covers key concepts such as statistical significance, types of errors, statistical power, and various statistical methods including t-tests and ANOVA. The workshop aims to equip participants with the skills to apply statistical tests, evaluate results, and understand the implications of their findings.
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

MEDC0006: DATA INTERPRETATION AND EVALUATION OF UCL FACULTY OF MEDICAL

SCIENCE SCIENCES

Workshop 4:
Hypothesis Testing

Dr Dallas Roulston
[Link]@[Link]

30th January 2024


UCL FACULTY OF MEDICAL SCIENCES

Learning Outcomes
At the end of this session, and having completed the preparatory work, you
will be able to;
1. Apply selected statistical tests appropriately to compare datasets,
2. Evaluate the significance of statistical results, and
3. Understand different types of error and statistical power.
UCL FACULTY OF MEDICAL SCIENCES

Session Outline
1. Introduction
2. Hypothesis Testing
2.1 Statistical Significance
2.2 Type 1 and Type 2 Errors
2.3 Statistical Power
2.4 p-values
3. Statistical Methods in Hypothesis Testing
3.1 t-test
3.2 ANOVA
3.3 Correlation and Linear Regression
4. Summary
UCL FACULTY OF MEDICAL SCIENCES

Introduction
Hypothesis Testing
Hypothesis testing is a key procedure in inferential statistics.
It is based on the premise that we can infer conclusions from a population based on a
sample from that population.
Hypothesis testing can be considered in 5 steps;
1. Formulate your hypothesis,
2. Determine the level of significance,
3. Sample the population,
4. Calculate the p-value, and
5. Interpret the data/draw your conclusion.
UCL FACULTY OF MEDICAL SCIENCES

Hypothesis Testing
Inferential statistics is based upon the premise that you cannot prove 1. Hypothesis,
something to be true, however, can disprove something by observing 2. Significance,
exceptions. 3. Sample,
Null hypothesis (H0) 4. p-value, and
5. Interpretation.
The observed difference is due to chance.
Researchers work to reject, nullify or disprove the null hypothesis.
Alternative hypothesis (H1/Ha)
Contradictory to the null hypothesis.
Researchers work to accept or prove the alternative hypothesis.
Hypotheses should be;
• about population parameters (not the sample),
• the H0 represents no effect or the status quo, and
• the H0 include a statement of equality, i.e. =, ≤, or ≥, however may be < or >.
UCL FACULTY OF MEDICAL SCIENCES

Statistical Significance
Statistical significance 1. Hypothesis,
2. Significance,
The probability of a given set of results being obtained if the H0 were
3. Sample,
true, that is the set of observed effect is due to chance, other factors, 4. p-value, and
etc. 5. Interpretation.
The probability that you will decide that the H0 is incorrect, when it is,
in fact, correct.
This is known as a type 1 error, of a false positive.
Level of significance (α)
We typically, unless there is good reason to, decide that results are significant if the
probability that our H0 is true is less than 5% (p = 0.05).
UCL FACULTY OF MEDICAL SCIENCES

Statistical Significance
Statistical significance refers to the claim that a set of 1. Hypothesis,
observed data are not the result of chance, but can 2. Significance,
instead be attributed to a specific cause. 3. Sample,
4. p-value, and
A high degree of statistical significance indicates that an 5. Interpretation.
observed relationship is unlikely to be due to chance.
The calculation of statistical significance is subject to a
certain degree of error.

Further reading
UCL FACULTY OF MEDICAL SCIENCES

Type 1 vs. Type 2 Errors


Type 1 error (false positive) 1. Hypothesis,
2. Significance,
A type 1 error occurs when a H0 that is true is rejected.
3. Sample,
The probability of committing a type 1 error is represented by α. 4. p-value, and
5. Interpretation.
Type 2 error (false negative)
Type 2 error occurs when a H0 that is false is accepted.
The probability of making a type 2 error is represented by β.

Further reading: type 1 error


Further reading: type 2 error
UCL FACULTY OF MEDICAL SCIENCES

Statistical Power
Power 1. Hypothesis,
2. Significance,
Power is the probability of rejecting a H0 when, in fact, it is false.
3. Sample,
Therefore, power is the probability of not making a type 2 error 4. p-value, and
(i.e., 1 – β). 5. Interpretation.

Factors affecting power


1) Effect size,
2) Variance, (or in the measured response, variable),
3) Sample size, and
4) Significance level (α)

Resource: video
UCL FACULTY OF MEDICAL SCIENCES

Sample
Sample 1. Hypothesis,
2. Significance,
Take a sample of the population.
3. Sample,
Remember: 4. p-value, and
• good sampling is required to ensure that results obtained are valid. 5. Interpretation.
• the sample, taken from the population, should represent the population and be
free from bias.

<Refer to Workshop 2 for further information on sampling and sampling methods>


UCL FACULTY OF MEDICAL SCIENCES

p-value
p-value 1. Hypothesis,
2. Significance,
A statistical measure used to validate a hypothesis against observed data.
3. Sample,
A p-value measures the probability of obtaining the observed results, 4. p-value, and
assuming that the H0 is true. 5. Interpretation.
If the level of significance is set at 5% (0.05), a p-value <0.05 is considered
statistically significant.
A p-value of <0.05 means that you can reject H0. This does not,
however, mean that there is a 95% probability that Ha is true.
The lower the p-value, the greater the statistical significance of
the observed difference.

Further reading
UCL FACULTY OF MEDICAL SCIENCES

Questions?
UCL FACULTY OF MEDICAL SCIENCES

t-test
UCL FACULTY OF MEDICAL SCIENCES

t-test
t-test
A type of inferential statistic used to determine if there is a significant difference between
the means of two groups.
t-tests are used when the data sets follow a normal distribution and have unknown
variances (but assumed to be equal), like the data set recorded from flipping a coin 100
times.
t-tests can be dependent or independent.

Further reading
UCL FACULTY OF MEDICAL SCIENCES

t-test
𝑥 − 𝜇0
Calculating the t-test 𝑡=
𝑠
⋅√𝑛

Calculating a t-test requires three fundamental data values, including;


• the difference between the mean values from each data set,
• the standard deviation of each group, and
• the number of data values.
The t-test calculates the difference between the means of the two groups and divides it
by the standard error of the difference.
The resulting value is called the t-statistic (tstat).
The tstat is compared to a critical value (tcrit) from a t-distribution table to determine the
probability that the difference between the means occurred by chance.
If the probability that the difference occurred by chance is low (usually <0.05), it is
considered to be statistically significant, and we can conclude that there is a significant
difference between the means of the two groups.
UCL FACULTY OF MEDICAL SCIENCES

t-test
Degrees of freedom
In a t-test, degrees of freedom (df) refer to the number of independent observations that
contribute to the estimate of the variance of a population. In other words, it is a measure
of the amount of freedom or flexibility that is available when estimating the variance of a
population.
The df are important because they determine the shape of the t-distribution, which is a
distribution of possible t-statistics that can be calculated from a given set of data.
The t-distribution is used to determine the probability that a given t-statistic occurred by
chance, and this probability is used to determine whether the difference between the
means of the two groups is statistically significant.
UCL FACULTY OF MEDICAL SCIENCES

t-test
UCL FACULTY OF MEDICAL SCIENCES

t-test
Paired vs. Unpaired t-test
A paired t-test is performed when analysing repeated measures experiments (within
subject).
An unpaired t-test is used when analysing independent measures experiments (between
subjects).
UCL FACULTY OF MEDICAL SCIENCES

t-test
One-tailed vs. two-tailed t-test
One-tailed t-tests allow for the possibility of an effect in one direction.
Two-tailed t-tests test for the possibility of an effect in two directions – both positive and
negative.
A two-tailed t-test will allocate half to each tail of the distribution of your test statistic.
• If α=0.05, i.e., 5%, 2.5% will be allocated to each tail.
UCL FACULTY OF MEDICAL SCIENCES

t-test
One-tailed t-test
When using a one-tailed t-test, all the α is allocated in one direction.
When using a one-tailed t-test, you are testing for the possibility of the relationship in one
direction, completely disregarding the possibility of the relationship in the other direction.
For example, the H0 is that the means are equal, a one-tailed t-tests will test either;
• if the mean is significantly greater than x, OR
• if the means is significantly less than x.
The mean is considered significant from x if the tstat
is in the top or bottom 5% (0.05) of its probability
distribution, resulting in a p-value of <0.05.
UCL FACULTY OF MEDICAL SCIENCES

t-test
One-tailed vs. two-tailed t-test
When using a two-tailed, regardless of the direction of the relationship you hypothesise,
you are testing the possibility of the relationship in both directions.
For example, the H0 is that the means are equal, a two-tailed t-tests will test both;
• if the mean is significantly greater than x, and
• If the means is significantly less than x.
The mean is considered significant from x if the tstat
is in the top or bottom 2.5% (0.025) of its
probability distribution, resulting in a p-value of
<0.05.
UCL FACULTY OF MEDICAL SCIENCES

t-test
Which to use?
A one-tailed t-test will provide greater power to detect the effect.
Before considering a one-tailed t-test, consider the consequences of missing the effect in
the other direction.
UCL FACULTY OF MEDICAL SCIENCES

t-test

One-tailed Two-tailed
UCL FACULTY OF MEDICAL SCIENCES

Exercise 1. t-test
A research study was conducted to examine the differences between older and Younger adults Older adults

younger adults on perceived life satisfaction. A pilot study was conducted to 34 45

examine this hypothesis. Ten older adults (over the age of 70) and ten younger 22 38
adults (between 20 and 30) were given a life satisfaction test (known to have 15 52
high reliability and validity). Scores on the measure range from 0 to 60 with 27 48
high scores indicative of high life satisfaction and low scores indicative of low 37 25
life satisfaction. The data are presented below.
41 39
Using the Data Analysis ToolPak on Microsoft Excel, compute the appropriate t- 24 51
test (paired or unpaired?), then complete the table and answer the questions
19 46
that follow.
26 55

36 46
Mean: Mean:

Variance: Variance:

Observation: Observation:
UCL FACULTY OF MEDICAL SCIENCES

Exercise 1. t-test
1. What type of t-test did you use?
2. What is your computed answer (i.e. tstat)?

3. What would be the H0 in this study?

4. What would be the H1?

5. What probability or level of significance (i.e., the α value) did you choose, and why?
6. What is your tcrit?

7. Is there a significant difference between the two groups?


8. Interpret your answer.
9. If you have made an error, would it be a type 1 or a type 2 error, and why?
UCL FACULTY OF MEDICAL SCIENCES

t-test
UCL FACULTY OF MEDICAL SCIENCES

ANOVA
(Analysis of Variance)
UCL FACULTY OF MEDICAL SCIENCES

Analysis of Variance (ANOVA)


ANOVA
Used to determine whether there are any statistically significant differences between the
means of three or more groups.
One independent variable
One-way (between-subjects) ANOVA
Repeated measures (within-subjects) ANOVA
Two independent variables
Two-way ANOVA
UCL FACULTY OF MEDICAL SCIENCES

ANOVA
One-Way ANOVA
Used to determine whether there are any statistically significant differences between the
means of three or more independent (unrelated) groups.
Also called between-subjects ANOVA.
UCL FACULTY OF MEDICAL SCIENCES

ANOVA
Repeated Measures ANOVA
The equivalent of the one-way ANOVA, but for related, not independent groups.
Also called within-subjects ANOVA.
UCL FACULTY OF MEDICAL SCIENCES

Two-Way ANOVA
Two-Way ANOVA
Compares the mean differences between groups that have been split on two independent
variables (called factors).
The primary purpose of a two-way ANOVA is to understand if there is an interaction
between the two independent variables on the dependent variable.
UCL FACULTY OF MEDICAL SCIENCES

Exercise 2. ANOVA
A research study was conducted to examine the clinical efficacy of a new antidepressant. Depressed patients
were randomly assigned to one of three groups: a placebo group, a group that received a low dose of the drug,
and a group that received a moderate dose of the drug. After four weeks of treatment, the patients completed
the Beck Depression Inventory. The higher the score, the more depressed the patient. The data are presented
below.

Using the Data Analysis Pak on Microsoft Excel, compute the appropriate test.
UCL FACULTY OF MEDICAL SCIENCES

One-Way ANOVA Exercise


Placebo Low Dose Moderate Dose
1. What is your computed answer?
38 22 14
2. What would be the H0 in this study? 47 19 26

39 8 11
3. What would be the H1?
25 23 18

4. What probability level did you choose and why? 42 31 5


Count: Count: Count:
5. What is your Fcrit? Mean: Mean: Mean:

Variance: Variance: Variance:


6. Is there a significant difference between the groups?

7. If there is a significant difference, where specifically are the


differences?

8. Interpret your answer.


UCL FACULTY OF MEDICAL SCIENCES

Correlation
and
Linear Regression
UCL FACULTY OF MEDICAL SCIENCES

Pearson’s Correlation
Pearson’s Correlation
Correlation describes the relationship between two different variables, x and y.
Correlation coefficients (r) are indicators of the strengths of this relationship.
No correlation: r = 0
Positive correlation: r > 0
Negative (inverse) correlation: r < 0
Remember:
UCL FACULTY OF MEDICAL SCIENCES

Simple Linear Regression


Simple linear regression
Simple linear regression is a statistical method for obtaining a formula to predict values of
one variable from another where there is a causal relationship between the two variables.
Central to simple linear regression is the formula for a straight line that is most commonly
represented as y = mx + c.
y: dependent (response) variable
x: independent (predictor) variable
m: gradient
c: y-intercept
UCL FACULTY OF MEDICAL SCIENCES

Exercise 3. Correlation and Linear Regression


It is hypothesised that there are fluctuations in norepinephrine (NE) levels which accompany
fluctuations in affect with bipolar affective disorder (manic-depressive illness). Thus, during
depressive states, NE levels drop; during manic states, NE levels increase.
To test this relationship, researchers measured the level of NE by measuring the metabolite
3-methoxy-4-hydroxyphenylglycol (MHPG in μg/24 h) in the patient's urine experiencing
varying levels of mania/depression. Increased levels of MHPG are correlated with increased
metabolism (thus higher levels) of the central nervous system NE. Levels of mania/
depression were also recorded on a scale with a low score indicating increased mania and a
high score increased depression.
The data is provided on the next slide.
UCL FACULTY OF MEDICAL SCIENCES

Exercise 3. Correlation and Linear Regression


MHPG Affect Score
1. Compute the correlation coefficient. 980 22
2. What does this statistic mean concerning the relationship between MHPG levels 1209 26
and affect? 1403 8

3. What percent of the variability is accounted for by the relationship between the 1950 10
two variables? 1814 5

4. What would be the slope and y-intercept for a regression line based on this data? 1280 19

1073 26
5. What would be the predicted affect score if the individual had an MHPG level of;
1066 12
a) 1100?
880 23
b) 950?
776 28
c) 700?
UCL FACULTY OF MEDICAL SCIENCES

Summary
Hypothesis Testing
In hypothesis testing, the hypothesis are made about the population.
We draw a sample from the population to draw inference about the population.
Sample means are calculated.
We use information about the sample to decide, using the p-value, whether there is evidence to suggest that
there is difference between the population means.
t-test
A type of inferential statistic used to determine if there is a significant difference between the means of two
groups.
t-tests are used when the data sets follow a normal distribution and have unknown variances (but assumed
to be equal), like the data set recorded from flipping a coin 100 times.
UCL FACULTY OF MEDICAL SCIENCES

Summary
ANOVA
Used to determine whether there are any statistically significant differences between the means of three or
more groups.
ANOVA can assess one independent variable, either between subjects (one-way ANOVA) or within subjects
(repeated measures ANOVA), or can assess two independent variables (two-way ANOVA).
Correlation and Linear Regression
Correlation describes the relationship between two different variables, x and y.
Simple linear regression is a statistical method for obtaining a formula to predict values of one variable from
another where there is a causal relationship between the two variables.
Central to simple linear regression is the formula for a straight line that is most commonly represented as
y = mx + c.
UCL FACULTY OF MEDICAL SCIENCES

Session Outline
1. Introduction
2. Hypothesis Testing
2.1 Statistical Significance
2.2 Type 1 and Type 2 Errors
2.3 Statistical Power
2.4 p-values
3. Statistical Methods in Hypothesis Testing
3.1 t-test
3.2 ANOVA
3.3 Correlation and Linear Regression
4. Summary
UCL FACULTY OF MEDICAL SCIENCES

Learning Outcomes
At the end of this session, and having completed the preparatory work, you
will be able to;
1. Apply selected statistical tests appropriately to compare datasets,
2. Evaluate the significance of statistical results, and
3. Understand different types of error and statistical power.
MEDC0006: DATA INTERPRETATION AND EVALUATION OF SCIENCE UCL FACULTY OF MEDICAL SCIENCES

Workshop 4:
Hypothesis Testing

Dr Dallas Roulston
[Link]@[Link]

30th January 2024

You might also like