Business Research Process Slp1
Business Research Process Slp1
correlated with mine stat quest hello and welcome to stat quest today we're going to talk
about the binomial distribution in the binomial test and they're going to be clearly explained
usually when people talk about the binomial distribution they talk about flipping a coin a coin
usually has heads in at least one tail for example you can use the binomial distribution to find
out the probability of getting six heads in six tosses but who really cares about flipping coins
what folks really want to know is whether or not people like orange Fanta more than grape
Fanta which flavor reigned supreme or are they both equally loved to answer this question
we can ask a bunch of people which flavor they prefer if everybody but one person said they
liked orange Fanta more than grape Fanta then it would be pretty obvious what people liked
most but what if four people say they like orange Fanta and three people say they'd like
grape Fanta is that enough to be confident than most people like orange Fanta or could it be
that people in general don't have a preference and these results are just due to random
chance and a small sample size maybe if we surveyed another seven people we might only
get three people who like orange Fanta and for people who like grape Fanta to get to the
bottom of this mystery we need to get a sense of what to expect if there is no preference
then we determine if our survey results fit those expectations if not we can reject the idea
that both Fantas are loved equally the binomial distribution will tell us what to expect if there
is no preference to say the same thing using statistics lingo we will use the binomial
distribution aka this nasty looking thing to model what to expect when there is no preference
then we'll see how well this model fits the data if the model is a poor fit we will reject the idea
that both flavors are loved equally so let's start with a super simple example and assume
that I asked three people if they liked orange Fanta more than grape Fanta the first person
we asked said they preferred orange Fanta the second person we asked also said they
preferred orange Fanta in the third person we asked said they preferred grape Fanta if
people really didn't prefer one flavor over the other then we will assume that there is a 50%
chance they will pick orange and a 50% chance they will pick grape we can then calculate
the probability of the first two people randomly choosing orange in the third person randomly
choosing grape assuming that there is no real preference the probability of the first person
preferring orange Fanta is 0.5 in the probability of the first two people preferring orange
Fanta is 0.5 times 0.5 which equals 0.25 and the probability of the first two people preferring
orange Fanta and the third person performing grape is 0.5 times 0.5 times 0.5 which equals
0.125 note 0.125 is the probability of the first two people saying they prefer orange and the
third person saying they prefer grape it is not the probability that any two out of three people
would prefer orange let me explain it could have just as easily been that the first person said
they preferred grape in this case the probability would still be 0.125 but we'd multiply the
numbers together in a different order likewise if the second person said they preferred grape
we just multiply the numbers together in a different order so all three of these combinations
are equally likely and this means that the probability that any two out of three people prefer
orange Fanta is the sum of the three possible orders so we just add the three probabilities
together in the probability that any two out of three people would randomly say they prefer
orange Fanta is 0.375 alternatively we could have done the math using this nasty-looking
formula X is the number of people who preferred orange Fanta in this case X equals 2 n is
the total number of people we asked in this case n equals 3 note n minus X the total number
of people we asked minus the number of people who preferred orange Fanta equals the
number of people who said they prefer grape Fanta P is the probability that someone will
pick orange Fanta in this case P equals 0.5 note the probability that someone might prefer
grape Fanta is 1 minus P together this says the probability of X the number of people who
say to prefer orange Fanta given in the number of people we asked and P the probability of
picking orange Fanta equals this nasty looking thing ooh it's got factorials don't freak out it
looks fancy but it just boils down to the number of different ways two of three people could
say they prefer orange Fanta when we did everything by hand we saw that there were three
ways for two of three people to say they prefer orange Fanta and if we plug in N equals 3
and x equals 2 and then just do the math we get three three ways that two out of three
people could prefer orange Fanta just like when we did it by hand so this fancy thing is really
no big deal the next part of the formula P to the X corresponds to the probability that orange
Fanta was chosen two of the three times in other words P to the X just consolidates 0.5
times 0.5 into 0.5 squared the last part of the equation corresponds to the probability that
someone preferred grape Fanta remember that one minus P is the probability that someone
prefers grape fine too and n minus X is the number of people that said they preferred grape
Fanta if we plug in N equals three x equals two and P equals zero point five and then do the
math we get zero point five so this term corresponds to the one person who liked grape
Fanta thus these two parts of the equation correspond to zero point five times zero point five
times zero point five and the nasty part just multiplies it by three now we can put all the parts
together and plug in x equals to the number of people that preferred orange Fanta in equals
three the number of people we asked and P equals 0.5 the probability someone would
randomly pick orange Fanta and we get the same probability that two out of three people
would randomly prefer orange Fanta that we got when we did everything by hand 0.375 in
other words the binomial distribution tells us that the probability that two of three people will
prefer orange Fanta due to random chance is 0.375 BAM calculating the probability of three
of three people saying they prefer orange Fanta by hand is pretty easy since there is only
one combination but we can just as easily use the fancy formula by plugging in x equals
three and then we just do the math this term equals one since we are dividing three factorial
by three factorial and this term is also equal one because anything raised to the zero power
equals one and then we just keep doing the math and this means that the probability of three
of three people randomly preferring orange Fanta is 0.125 which is exactly what we got
when we did the calculations by hand now that we've seen that we can calculate
probabilities with the binomial distribution let's go back to our original question if four people
say they'd like orange Fanta and three people say they'd like grape Fanta can we conclude
that people in general prefer orange Fanta now we plug in x equals for the number of people
that preferred orange Fanta n equals 7 the number of people we asked and P equals 0.5 the
probability someone would randomly pick orange Fanta and then just do the math and we
get zero point two seven three the probability that four of seven people would randomly
prefer orange Fanta double bam when you use a binomial distribution to calculate a p-value
it's called a binomial test so what's the p-value for four out of seven people preferring orange
Fanta the p-value is the probability of the observed data four of seven people prefer orange
Fanta plus the probabilities of all other possibilities that are equally likely or rare this means
we need to calculate these probabilities these are the observed results of our poll and these
are rare possibilities and we also need to calculate the probabilities of these combinations
these two possibilities for verses three and three versus four are equally rare if you don't
believe me plug in the numbers and see the remaining possibilities are rare in other words
by including possibilities when grape Fanta is preferred equally or more often we are
calculating a two-sided p-value if this is blowing your mind don't freak out just watch the stat
quests on p-values clearly explained and one and two sided p-values the links are in the
description below we've already calculated the probability that four out of seven people
prefer orange Fanta it's zero point two seven three for this we just set X to five and plug and
chug and we get zero point one six four then we get zero point zero five five and then we get
zero point zero zero eight adding the probabilities together gives us 0.5 the probability that
orange Fanta is preferred now we just plug and chug the numbers for when grape Fanta is
preferred adding the probabilities together gives us 0.5 the probability that orange Fanta is
not preferred the sum of the probabilities of all combinations of events that have an equal
probability or a rarer equals 0.5 plus 0.5 which equals 1 which means the p-value for 4 out of
7 people saying that prefer orange Fanta is 1 which means that the model the binomial
distribution with P equals 0.5 ie orange Fanta and grape Fanta are both equally loved is a
good fit for the observed data thus we conclude that given the sample size seven we cannot
rule out the possibility that both orange Fanta and grape Fanta are equally loved think about
that the next time you watch the World Series of baseball triple bam one last thing before
we're done the binomial distribution only works when the probability that someone likes
orange Fanta does not change if someone else already said they liked orange Fanta in other
words if we asked a bunch of people if they liked orange Fanta and they all say yes then that
should not affect the probability that the next person also likes orange Fanta hooray we've
made it to the end of another exciting stat quest if you like this stat quest and want to see
more of them please subscribe and if you want to support stat quest well please click the like
button below and consider buying one or two of my original songs alright until next time
quest on you