Let's talk a little bit about
controlling the margin of error:
So we worked through this example where we
measured BMI within a sample of 16
observations we found the sample mean to
be 25.2, sample standard deviation of 5
and we built a 95% confidence interval that was two-sided;
So this part here is what we call the margin of error
and I get it abbreviated M.E., and we saw in our particular example the margin
of error was 2.5,
now this may be a bit too wide for our liking
so we might prefer to get a margin of error that's
smaller, or a confidence interval
that's a bit narrower and more
precise in its estimate of the population's mean
so first let's talk a
little bit about what controls this
margin of error so we can think a bit about
how we can try and reduce it
so let's talk about how we can decrease
the margin of error
You can notice that the margin of error depends on
three things:
the t-value that we're using
the sample standard deviation and
the sample size
So let's think through all these theoretically:
so in order to decrease the margin of error we
can decrease the t-value that we're using
smaller t-value it's going to
mean a smaller margin of error;
but what does that mean in reality?
This is equivalent to decreasing our confidence
so rather than having 95% confidence we
can go down to say 60% confidence; that's
going to make interval narrower but
we're going to be the only 60 percent
confident that it contains a true value
and that's not really going to be useful
if we have an interval that we are not
very confident in.
Mathematically, we can also think about decreasing the
standard deviation, but this here
is not possible;
so if you think about it
here we're looking at people's BMIs
and there is some natural variability in that:
some people's BMI's are higher
some are lower, if you remember the
sample standard deviation
or standard deviation is trying to capture
on average, "on average" how far
the individual's BMI move from the mean okay
so there's no way for us to make
people's BMI more similar. okay there's
natural variability and we can't do anything about that
The final thing we can think about is
the sample size: we can see here
if we make the sample size larger
that's going to make this whole thing
here smaller or the margin of error smaller
So we can increase our
sample size and that's going to help us
decrease the margin of error
and there's not much cost to doing this other than
the time and money it takes to collect samples.
So let's just work through
an example we're going to see how we can
choose the margin of error that we want
and determine what sample size is needed
in order to get that margin of error
So let's suppose that we want a margin of
error of roughly 0.5,
or in other words we want our confidence interval to
go from our estimate plus or minus 0.5
what sample size are we going to need to
take in order to get that margin of error
okay so let's work our way there
we know that the margin of error is:
't' times 's' over the square root of 'n'
now we're just going to rearrange this a little bit;
what I'm going to do is
I am going to bring t to the other side here
and I'm also going to bring the sample
standard deviation to the other side
then what I'm going to do is just flip
both of these: t times s over the margin or error
is equal to the square root of n
and then finally I'm going to
square both sides and I'm just going to
write them on the other side so it looks a bit neater or more organized
n is equal to t times s over the margin of
error all squared.
so now we have a formula here where we can sub in
what is the level of confidence we want, what's
the estimate of the standard deviation,
what's the margin of error we want and
find out the sample size that's necessary.
so in this example here we say
we'd like to have a margin of error of 0.5
I am going to sub in the rough t-value of 2
if we want 95% confidence
we're gonna use a t-value or a z-value
of approximately 2 and our sample
standard deviation of 5;
and if we work this out it's going to come out to be 400
and again it's noted in earlier
videos I usually choose simple examples
with simple numbers so we don't get
distracted by calculations and we can
focus on the concepts.
Ok so now we know if we want to have a confidence interval
a 95% confidence interval with a margin
of error of approximately 0.5 we need to
take about 400, sample of size 400 in
order to achieve that.
So just some comments on this
the first is that it's good to make sure
you plan ahead of time so rather than
collecting say 16 observations finding
out your interval is too wide to be
useful, think ahead of time what size of
margin of error do you need or do you want
and then figure out what sample
size is necessary, okay and again as
noted before when we get to more
complicated estimates the formulas
become a little bit more complicated but
the underlying concept always holds.
A second note is that there's a push an
pull between in a real world and the ideal world;
In an ideal statistical world we want to take
400 observations to get the margin of error
that's desired; in a real world
collecting data takes time, it costs money
and there's always a balance
between what would you ideally like to
have and realistically what can you get your hands on
your hands on
A few other notes in this formula
what we end up doing is replacing
the t- value with z, again this is
mainly because here we're trying to work
out a sample size and the exact value of t
depends on the sample size okay so we
can get stuck in this back and forth
process also here when we're doing a
sample size calculation we're generally
looking at larger sample sizes at which
point the t distribution and the z are
approximately the same
so it's not going to make a big difference
A second thing you may have noticed is here we are
subbing in the standard deviation.
Now if you're going to do this
calculation ahead of time to decide what
sample size do you need you're likely
won't have the data to have estimated
the standard deviation yet,
So ways around this, ways we can get at that:
the first is by looking at
literature and seeing if similar studies
have been done or if there's anywhere in
the literature that gives you a good
estimate of what should the standard
deviation of BMIs be
if you don't have that,
do a small pilot study so you can
say collect 10, 15 observations get an
estimate of the standard deviation maybe
bump it up a little bit to be conservative
and go from there, or one final option
as if you know that the variable you are
measuring in this case BMI in the populations
is approximately normally
distributed you can make use of the fact
that we know for a normal about
99.7 percent of
observations stay within 3 standard deviations of the mean
okay or in other words the range is
approximately 6 standard deviations so
if you can have some expert knowledge
to know what's the rough minimum value and the
rough maximum value excluding the
extreme outliers, extreme values,
then you can get that range
divide it by 6 to get an estimate of
the standard deviation. so these are some
ways around!