Statistical hypothesis testing: The lottery tickets

in #steemstem7 years ago (edited)

Instead of knowing the probability of a certain event, like we know it from a Bernoulli process,a statistical hypothesis testing focuses on using a sample to test a hypothesis about the probability for a hit. It is like the principle: "in the doubt for the accused". A person isn't guilty as long as there isn't enough evidence to prove it. In statistical hypothesis testing, two outcomes are possible: The hypothesis is correct or it isn't. The hypothesis which will get tested has an area in which it will get accepted and otherwise it won't. For accepting it, the is a so called accepting range and for not accepting there is the rejection range which depends on the determined error probability  α.

The maximal turning point is located at the expected value. Until the grey line for the 95% significance threshold is reached, all values verifying the null hypothesis are between the very unlikely observations.

Example:

A seller claims, 25% of his lottery tickets are prices. A group of people buys 54 lottery tickets, from which 9 are prices. Accepting a significance niveau from 5%, is the seller telling the truth?

H0 : p = p1 = 25%

H1 : p ≠ p1  ≠ 25%

Expected value n*p= 0,25 * 54= 13,5

Standard deviation !n*p*(1-p) = 0,25*54*(1-0,25) = 3,17

As 5% is the error probability, we can use the 2σ range as the lower boundary P(X ≤ a) > 2,5% and the upper limit P(x ≤ b) > 97,5%. Because both, the right and the left side of the rejection area has to be considered, the probability of both is α /2.  Adding these two areas together, the result is 5%.  Using the sigma rules, 2σ range is suitable as it is about 95%, but mainly an approach, avoiding the complex integral for this problem.

P(µ - 2σ ≤ X ≤ µ + 2σ) = 95,4% 

2 standard deviations account for about 95% of the area left and right from the expectation value are laying under the 2nd standard deviation (68–95–99.7 rule)

for having a good approximation, σ should be > 3:

σ= 3,17 > 3

Lower limit  is: 13,5 - 1,96*3,17= 7,29 -> 8  

Upper limit is: 13,5+1,96*3,17= 19,7 -> 19

As 9 lies in between our two borders, the null hypothesis is getting accepted. Would the result lay under or above the accepting range, it would be rejected:

Lower result than 8 -> H1 is correct

Higher result than 19 -> H2 is correct

A hypothesis can never be absolutely proven right, but with a certain percentage. Failures can lay in between a small sample that gives wrong results about the average or other wrong assumptions. Results depend on the declared decission rules. Problematic is the fact, the hypothesis could be wrong by using a wrong probability or the hypothesis, but it could be still accepted as a right result. Vice versa, the second thing is, the probability could have been right, but it wasn't recognised. For statistical hypothesis testing, these two kinds of failures can occur:

Type 1 error:

An error because of the incorrect rejection of a true null hypothesis. The probability that this error occurs= α. To minimise this risk, α have to decrease.

This error is also called α -error

Type 2 error:

Incorrectly retaining a false null hypothesis, equaling the case in which someone isn't guilty, but the hypothesis says the person is and it's accepted, even though it is wrong.

This error is also called β-error

4 cases can occur, of which two are the type 1 & type 2 error



Source
Text
https://www.studyhelp.de/mathe/stochastik/hypothesentests/  (translated)
https://www.lernhelfer.de/schuelerlexikon/mathematik-abitur/artikel/beispiel-eines-signifikanztests  (translated)
http://www.mathematik-wissen.de/hypothesentest.htm   (translated)
https://www.schullv.de/resources/01_mathelv/01_basiswissen//signifikanztest_zweiseitiger_test_spickzettel.pdf  (translated)
https://en.wikipedia.org/wiki/Type_I_and_type_II_errors  
Pictures
http://blog.analytics-toolkit.com/wp-content/uploads/2017/09/2017-09-11-Statistical-Significance-P-Value-1.png
https://media-exp2.licdn.com/mpr/mpr/AAEAAQAAAAAAAAkZAAAAJDFmZDU3M2IzLTI3NjItNDlkOC04YmJiLTYxNWU2ODc5NDI1OA.png
https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Inferential_Statistics_Decision_Making_Table.png/500px-Inferential_Statistics_Decision_Making_Table.png

Coin Marketplace

STEEM 0.20
TRX 0.24
JST 0.038
BTC 96590.30
ETH 3333.92
USDT 1.00
SBD 3.16