T-test, ANOVA and Chi Squared test made easy.
Summary
TLDRThis educational video explores various statistical tests and their appropriate applications. It delves into the t-test, covering single sample, two-tailed, one-tailed, and paired tests, using real-world examples to elucidate the concepts. The video then moves on to ANOVA, demonstrating how it allows for comparing means across three or more populations. Additionally, the chi-squared test is introduced, addressing both goodness of fit and test of independence scenarios, enabling analyses of categorical variables and proportions. Throughout the video, the presenter emphasizes the importance of understanding the research question and selecting the appropriate statistical test accordingly, making the material highly accessible and engaging.
Takeaways
- π The key to understanding statistical tests is to first understand the question being asked.
- π€ For t-tests, we are examining the difference in means between two populations, or between one population at different points in time.
- π€ The null hypothesis assumes there is no difference in means, and we calculate the probability of observing our sample data if the null hypothesis were true.
- β If this probability is below a predetermined threshold (typically 0.05), we reject the null hypothesis and conclude the observed difference is statistically significant.
- π There are different types of t-tests: single sample, two-tailed, one-tailed, and paired t-tests, depending on the specific question being asked.
- βοΈ ANOVA (Analysis of Variance) is used when comparing means across three or more populations.
- π After an ANOVA identifies a significant difference, multiple comparisons can pinpoint which populations differ from each other.
- π Chi-squared tests are used to test for differences in proportions of categorical variables.
- βοΈ The chi-squared goodness-of-fit test examines if observed proportions match expected proportions.
- π The chi-squared test of independence checks if the proportions of one categorical variable depend on the values of another variable.
Q & A
What are the three main statistical tests covered in the video?
-The three main statistical tests covered in the video are the t-test, ANOVA (analysis of variance), and the chi-squared test.
What is the purpose of the t-test?
-The t-test is used to test the difference in means or averages between two populations, between one population at different points in time, or between a sample mean and a presumed or hypothesized mean.
What is the difference between a one-tailed and two-tailed t-test?
-A two-tailed t-test is used when we are asking if there is a difference in any direction, while a one-tailed t-test is used when we are asking if there is a difference in a particular direction.
When is a paired t-test used?
-A paired t-test is used when there are paired observations in each population, meaning that for each observation in one population, there is a corresponding observation in the other population.
What is the purpose of ANOVA?
-ANOVA (analysis of variance) is used to compare the means of three or more populations. It tests the null hypothesis that there are no differences in the means of these populations.
How can you determine which specific populations are driving the difference in means after conducting an ANOVA?
-After conducting an ANOVA and rejecting the null hypothesis, a multiple comparison of means (such as Tukey's test) can be performed to identify which specific populations have statistically significant differences in their means.
What is the chi-squared goodness of fit test used for?
-The chi-squared goodness of fit test is used to determine if the observed proportions of a categorical variable are significantly different from the expected proportions based on a hypothesized distribution.
What is the purpose of the chi-squared test of independence?
-The chi-squared test of independence is used to determine if there is a significant relationship between two categorical variables, i.e., if the proportions of one variable are independent of the other variable.
What is the null hypothesis being tested in a chi-squared test?
-In a chi-squared test, the null hypothesis is that there is no difference in proportions (for goodness of fit) or that the variables are independent of each other (for test of independence).
How is the decision to reject or accept the null hypothesis made in hypothesis testing?
-The decision to reject or accept the null hypothesis is made by comparing the calculated p-value to a predetermined significance level (typically 0.05). If the p-value is less than the significance level, the null hypothesis is rejected, indicating a statistically significant result.
Outlines
π₯ Introduction to Statistical Tests
This paragraph introduces the topic of the video, which is an explanation of different statistical tests: t-test, ANOVA (Analysis of Variance), and chi-squared test. It sets the context by stating that understanding the question being asked is crucial to determining the appropriate test and interpreting the results correctly. The paragraph also provides an overview of the specific types of t-tests (single sample, two-tailed, one-tailed, and paired) and chi-squared tests (goodness of fit and test of independence) that will be covered.
βοΈ Exploring the T-Test
This paragraph delves into the details of the t-test, using real data and examples to illustrate different scenarios and applications. It explains that the t-test is used to analyze the difference in means or averages between two populations, one population at different points in time, or a sample mean compared to a hypothesized or presumed average. The concept of hypothesis testing is introduced, where the null hypothesis assumes no difference in means, and the alternative hypothesis states that the observed difference is statistically significant. The paragraph walks through the process of determining statistical significance, considering the p-value and predetermined threshold (often 0.05).
π ANOVA and Chi-Squared Tests
This paragraph covers two additional statistical tests: ANOVA (Analysis of Variance) and the chi-squared test. For ANOVA, it explains that it is used when comparing the means of three or more populations, with the null hypothesis being no difference in means across populations. The paragraph uses real data and visualizations to illustrate the ANOVA process and interpretation of results, including multiple comparisons and confidence intervals. For the chi-squared test, the paragraph introduces the goodness of fit test and the test of independence, both used to analyze categorical variables and proportions. It explains the process of hypothesis testing, setting the null hypothesis of no difference in proportions, and using the p-value and predetermined threshold to determine statistical significance.
Mindmap
Keywords
π‘T-test
π‘Null hypothesis
π‘P-value
π‘ANOVA (Analysis of Variance)
π‘Chi-squared test
π‘Hypothesis testing
π‘Paired t-test
π‘One-tailed and two-tailed tests
π‘Confidence interval
π‘Statistical significance
Highlights
When doing statistical tests, it's important to understand the question you're asking, and then it becomes easy to understand and interpret the results and decide which test to do.
For the t-test, there are single sample, two-tailed, one-tailed, and paired tests.
When doing a t-test, we're asking about the difference in means or averages between two populations, one population at different points in time, or between a sample mean and a presumed mean.
In hypothesis testing, we assume the null hypothesis (no difference in means), and if the probability of getting our sample data is very low under this assumption, we reject the null and accept that the difference is statistically significant.
For a single sample t-test, we compare the sample mean to a presumed population mean to see if the difference is statistically significant.
For a two-sample t-test, we can do a two-tailed test (is there a difference in any direction?) or a one-tailed test (is the difference in a particular direction?).
A paired t-test is used when there are pairs of observations, one from each population, matched together (e.g., life expectancy in Africa in 1957 and 2007).
For comparing means of three or more populations, we use ANOVA (analysis of variance).
After finding a significant difference with ANOVA, we can use multiple comparison tests to tease out which specific population means differ.
The chi-squared test is used for categorical variables and proportions, testing if the proportions across categories differ from expected values.
The chi-squared goodness of fit test checks if the observed proportions differ significantly from expected equal proportions.
The chi-squared test of independence checks if the proportions of one categorical variable depend on the values of another categorical variable.
In all tests, if the p-value is below a predetermined threshold (usually 0.05), we reject the null hypothesis and conclude the observed difference or relationship is statistically significant.
The key principles are the same across tests: assuming a null hypothesis of no difference, calculating the probability of getting the observed data under that assumption, and rejecting the null if that probability is very low.
Proper statistical testing requires determining the threshold for significance beforehand, to avoid p-hacking (adjusting criteria based on results).
Transcripts
welcome back to this global health
youtube channel in this video we're
going to be talking about statistical
tests which test to do when it's not
complicated and the key is to understand
what question it is that you're asking
and when you understand the question it
becomes very easy to understand and
interpret the results and to decide
which tests to do when so don't go away
stick with me you're going to love this
we're going to cover three things in
this video the t-test anova which is
analysis of variance and the chi-squared
test for the t-test there'll be the
single sample there's going to be
two-tailed one-tailed and paired right
we're going to do all four of those
things and for the chi squared there's
the goodness of fit and of course
there's also the test of independence
right you're going to find all of this
super duper easy to understand so stick
with me don't go away let's do this
let's talk about the t-test right and
i've got real data and real examples
here and we're going to look at four
different scenarios four different
applications of the t-test looking at
this data when we do a t-test we're
asking a question about the difference
in means or averages difference between
two populations or difference between
one population at different points in
time or the difference in an average
mean that we're seeing compared to some
sort of hypothesized or presumed average
right or presumed mean and we're asking
the question is our sample can from our
sample diet can we make inference about
the wider population is this somehow
representative of the truth that's out
there representative of the population
from which the sample was taken in other
words is this statistically significant
and this is how hypothesis testing works
we assume the opposite the
counterfactual the antithesis we assume
that there's no difference in means
between these two populations
if that were true and we call that the
null hypothesis if that were true
then how likely would it be that we
would get a sample
from the population that shows a
difference that we're seeing
or greater what is the probability of
that if we find that that is very
improbable and we decide up front by the
way we decide upfront what we consider
what the threshold for what we would
consider to be very improbable
what do we mean by very and we we often
use five percent if it's five percent or
less in terms of likelihood or
probability if we cons if it would be
very improbable to get a sample
like we've gotten
if the null hypothesis were true
and it would be very improbable to get
the sample but we have gotten the sample
we can then make the inference that the
null hypothesis must in fact be
incorrect that this assumption that
there's no difference that that's
incorrect we can reject that and we can
accept the fact that there is in fact a
difference and that our sample data is
statistically significant and that's how
hypothesis testing works so the first
example here at the top on the left is a
single sample t-test in other words
we've just got one sample just in this
case we've just got life expectancy in
africa so we've just taken africa we've
got life expectancy uh we don't have two
populations we've got one population
it's just africa and we've got a
presumed life expectancy or presumed
mean it could be for any old reason
there could be any reason why we believe
that life expectancy should be 50 or
should be 55 it could be any number and
we would ask the question is that the
sample that we've got
48.9 years is that statistically
significantly different from that
presumed mean or that presumed
population mean and then you get you
basically get a p-value if that p-value
is less than point zero five or five
percent if that if that's the number
that you've chosen as a threshold it
could be different
uh then if if it's if it's less than
that threshold and it's usually 0.00.05
then we can reject the null hypothesis
that the average is whatever it is that
we assumed it to be and we can accept
the fact that the the the the the sample
mean that we've gotten is statistically
significant okay that's the easiest
example if you understand that one
you'll understand the rest of these
super duper easy let's keep going in
these two examples and i've got two here
just to illustrate the fact that there's
two possible ways of asking this next
kind of question we've got we've got
life expectancy in africa and and in
europe in the top right hand corner and
we've got life expectancy in ireland and
in switzerland at the bottom bottom left
over here now the reason i've got two
here is just to highlight the fact that
there's two ways of doing this we could
ask the question
is there
a difference without specifying in which
direction so is there a difference for
example between the life expectancy in
ireland and the life expectancy in
switzerland and we might say look we
don't know in which direction the
difference might be we're just asking
are these are they the same or are they
different is the difference that we're
seeing here statistically significant
would we expect to see a difference of
this magnitude
or more if it were the case that in you
know in the scenario of the null
hypothesis that in fact ireland and
switzerland have the exact same
life expectancy and if and if that
probability is less than 0.05 if that's
our threshold then we would say that it
is statistically significant we reject
the null hypothesis we reject the notion
that they've got the same life
expectancy and we accept the fact that a
life expectancy that that this is
statistically significant we could
approach the same
the exact same problem in a slightly
different way and let's look let's use
africa and europe for that we could say
look we want to ask the question
is it statistically significant that
that africa is
that that africa has a life expectancy
less than europe of this magnitude so we
might go into the question saying we
know that africa has got a life
expectancy less than europe
we're asking
is a difference of this magnitude
statistically significant so we're not
asking is there a difference in any
direction
we're saying there is a we think there
is a difference
we think that the difference we think
that africa has a a different
we're asking is africa is the life
expectancy in africa less than europe
by this magnitude or more and is that
statistically significant and under
those circumstances you do a one-tailed
t-test does that make sense two-tailed
if you're saying is there a difference
in any direction one tailed if you're
saying is there a difference in a
particular direction
okay you got it and in both cases the
null hypothesis is that both populations
have got the same mean that that there's
no difference between the life
expectancy in the two populations now
here's the last example and this is this
is what i want you to understand this is
a paired tea test so we've got a one a
one tailed and a two-tailed over there a
paired t-test and this illustrates it
quite nicely
we've got a life expectancy in africa in
1957 and then the life expectancy in
africa in 2007.
so it's
for each sample
for each observation in
the 1957 there is a counterpart in 2007
right so
one in africa in 1957 one of the
examples would be south africa there'd
be a life expectancy that's one of the
observations but in 2007 there would
also be an observation that was south
africa right and there'd be an a life
expectancy there's malawi in both cases
zimbabwe in both in both in both samples
in other words there are these pairs
there is a counterpart in each
population and under those circumstances
you do a paired t test and all of the
principles the exact same principles
apply right you can it can be one-sided
two-sided
and and of course the p-value of less
than a threshold that you just determine
up front
anything less than that threshold if
it's if it's if it's five percent means
that the null hypothesis gets rejected
the null hypothesis is that both of
these have got the exact same life
expectancy the exact same mean and if
that's not the case if we reject that we
can accept that the difference that
we're seeing is
statistically significant all right got
it let's keep going next we're going to
talk about anova so here we've got
the we've got two means right if we want
to add a third what do we do we can't do
we can't do three means with the t-test
we would do an analysis of variance
anova all right so let's look at that
next
analysis of variance we're trying to
basically answer the same kind of
question that we were with the t-test
but except now we've got
three populations and we want to com
three or more populations and we wanted
to compare the means right the null
hypothesis is still the same that the
null hypothesis is that there are no
differences in the means of these
populations
and the alternative hypothesis is that
in fact there is a difference that the
difference we're seeing is statistically
significant right in this case i've used
box plots and density uh density plots
to to illustrate the difference in means
in three populations we've got europe
the americas and asia this is taken from
the gap-minded data this is real data so
it's super duper interesting and we're
seeing here that the data is showing a
difference in the means across these
different population groups right the
question is is that difference real and
if we do a an anova test it will show a
p-value that's very small but once
you've done that right you've done the
anova test you've shown that there's a
small p value we can reject the null
hypothesis which is that there's no
difference in the means we can accept
the fact that there is some sort of
statistical difference uh how then do we
tease out where that what's driving that
difference right because all that
conclusion all we can conclude from that
is that
one of
these populations is different from the
others and sometimes there's that you
know you may have more than three here
and you can do there are ways of
determining
uh
where that what's driving that
difference
and what i've done here is i've fed our
model into what's called a two key
multiple comparison of means and it's
taken each of the options you know asia
and america europe and america and
europe and asia and looked at them
individually right and if you look at
the results of it it's quite interesting
because you can sort of see well
between asia and america
there is a difference of
minus two or the difference of 2 it
doesn't really matter the magnitude
doesn't matter but the confidence
interval for that difference is between
-6 and 0.72 now and here you can see it
diagrammatically that confidence
interval crosses the zero threshold in
other words the confidence interval the
95 confidence interval includes the
possibility of a zero which a zero means
there's zero difference in other words
it includes the possibility that there's
no difference between those two
population means however europe and
america right we've got a difference of
four the confidence interval does not
include zero it's from zero point three
to seven point two
and uh and in europe to asia again same
story quite a big difference and the
difference does not include the
possibility of zero of no difference and
as you would expect the p values the
adjusted p values uh
bears that out so in the asia to america
where the confidence interval included
zero the p value does not cross the
threshold of of a five percent or less
it's 0.14 but the other two where the
confidence interval does not include
zero does not include the possibility of
no difference they both have small p
values less than point zero
point zero
point zero five okay got it
now let's talk about the chi-squared
test there's two of them right there's
the goodness of fatigue test and there's
the chi squared test of independence now
really what we're looking at here is
categorical variables and proportions of
categorical variables and this is a
great test to kind of test the notion
right we're testing whether or not there
in fact is a difference in the
proportions across the different
categories okay so let's have a look at
that right so here we've got
some flowers these happen to be irises
and we know that they come in we've
categorized them as small medium and
large
and in the first instance we could ask
the question are the proportion of
flowers that are small medium large the
same do we expect to see the same number
of small medium and large flowers in a
random sample that we take from the
population and we answer that question
by doing a chi-squared goodness of fit
test let's have a look at that
and again we're talking about hypothesis
testing in other words
if if it were the case
that there wasn't a difference in
proportions that would be our null
hypothesis right our null hypothesis is
that there's no difference in proportion
in the proportion of small medium and
large
flowers
right if that were true and we took a
random sample and that random sample
happened to show a difference in
proportions as large as or bigger than
the difference we're seeing now we would
consider if if that if if that
eventuality was considered to be
extremely unlikely then we could reject
the idea that they're all the same
proportions and we could accept the fact
that what we're seeing in the data is in
fact statistically significant what do
we mean by extremely unlikely well we've
got a cut-off point called the alpha
value that's the probability you know
how small this how small must that
probability be for us to consider it to
be
not like like
unacceptably smaller to the point that
we wouldn't really believe that we
wouldn't accept the null hypothesis to
be true
right and and usually we use 0.5 as
we've talked about so many times in
these videos
so we do a chi-square test we take the
starter we make a table put it into the
chi-square test and we get a p-value
that p-value is that probability if that
p-value is less than the threshold we
talked about usually 0.05 but it could
be anything depending on what it is that
you're trying to measure and how
important your sort of discrimination is
if that p-value is less than the
threshold and we reject the null we
accept the alternative and we say that
this difference that we're seeing in the
data is in fact statistically
significant and the exact same principle
applies to the chi-square test of
independence we're asking the question
are the proportions of
our species
are they in any way dependent or are
they independent of the size of the
flowers is knowing the value
you knowing this is does knowing the
size of the flower tell us anything
about the probability of a particular
flower being in one of these species
right looking at these graphs it seems
that that is the case but we need to
demonstrate that statistically so we do
a
chi-square test of independence and we
get a p-value if the p-value is very
very small beyond a pre-determined
threshold remember it has to be
predetermined you can't do it rest
retrospectively that's p hacking bad
science
uh if it's if the p value is very small
in other words the probability of a
sample showing a a difference in
proportions or a a relationship which is
demonstrated by difference in
proportions of this magnitude or more
the probability of that being the case
in the event that the null hypothesis
was was true in other words that there
was no difference if that proper
probability is extremely small we reject
the notion that these things are all the
same that the proportions are the same
and accept the fact that in fact what
we're seeing in the data this difference
that we're seeing this relationship that
we're seeing is in fact statistically
significant
right that's the chi-squared test of
independence now stay and watch another
video share this video with people that
you think might find it useful subscribe
to this channel if you haven't hit the
bell notification if you want
notification of future videos
take care
don't do drugs always do your best don't
ever change speak to you again soon
Browse More Related Video
How To Know Which Statistical Test To Use For Hypothesis Testing
uji hipotesis rata-rata 2 populasi (sampel independen)
How to calculate One Tail and Two Tail Tests For Hypothesis Testing.
Statistics in 10 minutes. Hypothesis testing, the p value, t-test, chi squared, ANOVA and more
ANOVA vs Regression
Perbedaan Statistika Parametrik dan Non Parametrik
5.0 / 5 (0 votes)