Intro to Inferential Statistics

There are many ways to use statistics in the world.
Descriptive statistics often used include:
Highest value
Lowest value
Average value (arithmetic)
Median value (half the values fall below)
Mode (most common value)
But most of modern statistics depends on the idea of a ‘normal’ distribution.
Many numbers that people want statistics about, such as height and weight, have small percentages at the extremes, and large percentages in the middle.

https://www.reddit.com/r/dataisbeautiful/comments/xmeh3p/oc_body_height_reported_by_us_men/

Even things which do not behave this way, can be made to have a ‘normal’ distribution.
If you flip a single, fair coin, it should have an equal probability of heads versus tails.
If you roll a single, fair die, it should have an even distribution of the numbers 1...6, 
(unless you are using Dungeons and Dragons dice).

But if you flip even TWO coins, the distribution is no longer even:
HH	HT	TT
1	2	1
This is because if you AVERAGE or TOTAL several numbers, the result is more likely to be in the mid-range.
The more coins you flip together, the more the distribution bulges in the middle.

If you do the sum of two dice, there are 36 results possible (6*6) but the sum ranges from 2 (snake eyes) to 12 (box cars), and the distribution is no longer even.

So, even if you start with a perfectly even distribution, you can GET a normal distribution by averaging a small group of values.

So why is this important? It turns out, that all such distributions have aspects in common.
In fact, if you take ANY normal distribution, you can produce what is called a ‘standard normal’ distribution.

There are two important aspects of a distribution:
What is the average, and how much do the values vary.

EXAMPLE:
Samples:
A	B	C	D
1	90	99	100
199	110	101	100

Samples A,B,C, and D all have exactly the SAME average.
But, intuitively, A varies a LOT more than D does.

One simple measure is to compute how far each value is from the sample average:
A	ave	dist	B	ave	dist	C	ave	dist	D	ave	dist
1	100	99	90	100	10	99	100	1	100	100	0
199	100	99	110	100	10	101	100	1	100	100	0

So; for sample A, the average distance from the average is 100, but the average distance from the average for sample D is 0.  Clearly, A varies a lot more than D.

No one actually uses average distance from the average in statistics.
(If you ever program it, remember that you have to use absolute value before you sum the distances.)

For reasons which involve calculus and other math concepts, VARIANCE is the sum of the SQUARED distances from the average.
(If you square, you do not need to worry about absolute values, either)
Standard Deviation is the square root of the variance.
(Standard Deviation can also depend on the sample size.)

This is an over-simplification (I have had three graduate level courses in statistics) but the idea is, I hope, clear.  This is how you measure ‘spread’ of a data set.

INTERESTING FACT:
If you take ANY normal distribution, subtract the average, and divide it by the standard deviation, you get a ‘standard normal’ distribution.  If you take any single value from that distribution, subtract the average of the population, and divide by the standard deviation of the population, you get what is called a ‘z score’ for the ‘standard normal’ distribution.
https://math.arizona.edu/~rsims/ma464/standardnormaltable.pdf
This allows you to remark learnedly about probability, once you master the details.
(So, take a statistics course!)

Say someone rolls snake eyes.  
Mean total of a pair of dice is 7.
Standard deviation is about 2.4.
(Did I mention that Excel can compute statistics for you?)
So, for snake eyes, the Z score is:
(2 – 7)/2.4 which comes out to -2.07039
In the standard table (https://math.arizona.edu/~rsims/ma464/standardnormaltable.pdf)
I look up -2.07, and it says 0.01923, which means there is about a 2% chance of that occurring by chance. It gives a very real answer to how likely an event is.
(And if you roll snake eyes consistently more than one time in 36 tries, that would be far less likely than rolling snake eyes once.)

In some situations, researchers are excited when the probability of an event is less than 5%, in other situations researches do not get excited until the probability of an event is less than 1%.  

If you know the mean and standard deviation of a normal distribution, you also know:
About two thirds of the population values are within 1 standard deviation of the mean.
About 95% of the population values are within 2 standard deviations of the mean.
If a value is more than 3 standard deviations from the mean, it is a very unlikely value.

If you hear people talking about surveys, and they say, “plus or minus X”, then X is the standard deviation for the population.  

If you are dealing with random generation of test data, or try to make statements of probability about system performance, you should definitely learn more about statistics.

EXAMPLE:

Hercules claims he has the strength of ten ordinary men because he is the son of Zeus. You find from the International Association of Burly weight Lifters that the average burly male weightlifter can bench press 200 pounds, with a standard deviation of 20.  Hercules just bench pressed 1000 pounds.

Z score: (1000 – 200) / 20 is around 40.
 
40 is way off the chart; the probability of a person lifting that much is in the .99997 range, which means only .003 % of people can lift that much.  Therefore, we say that Hercules probably can lift more than the average Burly Weightlifter, with a probability greater than 99.997%.
(Ordinary men lift only 100 pounds with a standard deviation of 50.)

However, this says nothing about the parentage of Hercules.

All number in  this example were made up.

EXAMPLE:
You have been told that an apple a day keeps the doctor away.
The NULL HYPOTHESIS is that apple consumption makes no difference.
(The NULL hypothesis is that what you are checking is not true.)

The EXPERIMENTAL hypothesis is that people who eat apples have fewer doctor visits.
(The EXPERIMENTAL hypothesis is what you are trying to prove)

You do not actually care if people who eat apples have MORE doctor visits, so you can use a one-tailed test.  (If the hypothesis were people who eat apples have a different number of doctor visits, it would be a two tailed test.)
You have randomly assigned people into groups.  The experimental group is required to eat exactly one apple per day.  The control group is forbidden to eat apples.

The standard deviation estimate for the WHOLE POPULATION is estimated from the standard deviation of both samples.  SD = SQRT((SD1^2 + SD2^2)/2).

 The two averages are compared by subtraction:
Average(experimental) – average(control)
The statistic is (Average(experimental) – average(control))/SD
If the sample is large enough, this would be a Z score; if the sample is small, it is a different distribution, called the t distribution.

If the probability of the Z score is towards the end of the normal distribution, you may have a publishable result.  
 (> 1.65 for a one tailed test,  >1.97 or <-1.97 for a two tailed test usually means you have a 95% chance that there is a difference.)  
Fortunately, spreadsheets can do the calculations for us.
This is an OVERSIMPLIFICATION; take a statistics class to have a better understanding.

https://en.wikipedia.org/wiki/Student%27s_t-test