Statistiek
Table of Contents
DEEL 1: introduction to probability.....................................................................................5
4. Definitions of Probability..........................................................................................................5
5. Jeffrey’s axiom system..............................................................................................................5
5.16 Theorem I (Bayes Theorem)....................................................................................................................5
6. Bayes’ Theorem........................................................................................................................5
6.2 voorbeeld..................................................................................................................................................7
7. Sensititvity and specificity........................................................................................................7
8. Multinational Naive Bayes Classifier.........................................................................................8
8.2 voorbeeld..................................................................................................................................................8
8.3 Interactie-effecten....................................................................................................................................8
8.4 Zero probabilities......................................................................................................................................8
9. Law of large numbers...............................................................................................................8
DEEL 2: Probability Distributions........................................................................................9
11. Bernoulli distribution..............................................................................................................9
12. Binomial distribution..............................................................................................................9
13 Multinomial distributions........................................................................................................9
14. Uniforme verdeling.................................................................................................................9
15.12 Expected value....................................................................................................................................10
15.22 Random Number generator................................................................................................................10
15.24 Example...............................................................................................................................................10
15.32 Related distribution............................................................................................................................10
16. Gaussian Naive Bayes Classifier............................................................................................11
16.3 voorbeeld..............................................................................................................................................11
17.Chi-distribution – overgeslagen..............................................................................................12
18. Chi-squared Distribution.......................................................................................................12
18.1 Probability Density Function.................................................................................................................12
19 Chi-squared Distribution (2 parameters) Niet kennen...........................................................13
20 Student t-Distribution...........................................................................................................13
21 Fisher F-Distribution..............................................................................................................13
DEEL 3.1: Descriptive Statistics & Exploratory Data Analysis.............................................14
23. Types of data........................................................................................................................14
23.1 Qualitative data.....................................................................................................................................14
23.2 Quantitative data..................................................................................................................................14
25. Frequency Plot (Bar plot)......................................................................................................14
26. Frequency tabel....................................................................................................................14
27.Contingency table..................................................................................................................14
28. Binomial Classification Metrics.............................................................................................15
, 29. Confusion matrix..................................................................................................................15
30. Stem- and -leaf plot..............................................................................................................15
31. Histogram.............................................................................................................................16
32. Quantiles – kwantielen.........................................................................................................16
33. Central Tendancy - centrummaten........................................................................................16
34.17 Interquartile difference.......................................................................................................................17
34.30 Relationship between MAD, QD and s................................................................................................17
35. Skewness & kurtosis.............................................................................................................17
35.17 Example Skewness en kurtosis test....................................................................................................18
36. concentration – niet kennen.................................................................................................19
37. Notched Boxplot...................................................................................................................19
38. Scatterplot............................................................................................................................21
39. Pearson correlation...............................................................................................................22
39.5 RFC........................................................................................................................................................22
39.7 Phi coëfficiënt.......................................................................................................................................22
40. Rank correlation – rang correlatie.........................................................................................22
41. Partial Pearson correlation - Partiële pearson correlatie.......................................................22
41.5 Example.................................................................................................................................................22
42. Lineair regression - Lineaire regressie...................................................................................23
43. Moments - Momenten..........................................................................................................24
44. QQPlot..................................................................................................................................24
46. Probability Plot Correlation Coefficient Plot - PPCC Plot........................................................24
47. Kernel Density Estimation.....................................................................................................25
48 Bivariate Kernel Density Plot.................................................................................................25
49. Bootstrap Plot.......................................................................................................................25
50 Survey Scores Rank Order Comparison.................................................................................25
51. Cronbach Alpha....................................................................................................................26
DEEL 3.2 Tijdsreeksen.......................................................................................................27
52. Tijdsreeksen..........................................................................................................................27
53. Time series plot....................................................................................................................27
54. Mean plot.............................................................................................................................28
Voorbeeld 54.4.2...........................................................................................................................................28
55. Blocked Bootstrap Plot (for central tendacy).........................................................................29
56. Standard Deviation Mean Plot..............................................................................................30
57 Variance Reduction Matrix.....................................................................................................30
58. (Partiële) Autocorrelatie functie............................................................................................32
59. Periodogram & Cumulative periodogram..............................................................................32
DEEL 4: Hypothesis Testing...............................................................................................33
, Onderliggende theorie: hfdst 61 – hfdst 76.................................................................................33
62. The population – populatie...................................................................................................33
63. The sample...........................................................................................................................33
68. Centrale limiet stelling..........................................................................................................33
69. Statistical test of the population mean with known variance................................................33
69.1.3.Critical region - Software...................................................................................................................34
70. Statistical test of the population mean with unknown variance............................................39
71. Statistical test of the variance...............................................................................................39
72. Statistical test of the population proportion.........................................................................39
73. statistical test of the standard deviation...............................................................................39
74. Statistical test of the difference between means..................................................................39
78: One sample t-test.................................................................................................................39
Voorbeeld 78.2.3...........................................................................................................................................40
79. Skewness & Kurtosis test......................................................................................................41
80. Paired two sample t-test.......................................................................................................42
82. Wilcoxon Signed Rank Test....................................................................................................45
83. Unpaired two sample t-test..................................................................................................45
84. Mann-Whithney U test.........................................................................................................46
85. Bayesian two sample test.....................................................................................................46
86. Median test bases on Notched Boxplots...............................................................................46
87 Chi-squared Test for Count data.............................................................................................46
88. One Way Analysis of Variance – One Way ANOVA.................................................................47
89. Two Way Analysis of Variance...............................................................................................49
89.1.3 Output................................................................................................................................................49
90: testing correlations...............................................................................................................51
91. A Note on Causality..............................................................................................................51
DEEL 5: Regressions models..............................................................................................52
93. Simple lineair regression model............................................................................................52
93.3 Ordinary Least Squares for Simple Linear Regression..........................................................52
94. Multiple Lineair Regression Model........................................................................................52
94.1.4 Minimum Variance (Gauss-Markov Theorem)..................................................................53
94.1.7 Determination Coefficient (R2).........................................................................................53
94.1.8 Relationship between the SLRM and MLRM....................................................................53
94.2. gaan we niet doen!............................................................................................................53
95. Hypothesis Testing with Lineair Regression Models..............................................................53
Oefeningen in R-studio.....................................................................................................54
95.4 Misspecificatie van regressie...............................................................................................60
, 95.5 Multicollineariteit in regressie..............................................................................................................66
R-tutorial.........................................................................................................................67
Assingnments................................................................................................................................................67
Relational operators......................................................................................................................................68
Logical values................................................................................................................................................68
Foutmeldingen..............................................................................................................................................68
Help files.......................................................................................................................................................68
Atomic (= van hetzelfde type/ soort) vectors (= lijst van getallen, teksten, logical values, …).....................69
Recycleren.....................................................................................................................................................69
Indexing.........................................................................................................................................................69
Missing values...............................................................................................................................................69
Speciale tekens...........................................................................................................................72
DEEL 6: introduction to Time Series Analysis.....................................................................72
97 Case: the market of health and personal care products.........................................................72
DEEL 7: Box-Jenkins Analysis............................................................................................79
100 Introduction to Box-Jenkins Analysis....................................................................................79
101 Theoretical concepts............................................................................................................79
101.1 stationariteit.......................................................................................................................................79
101.2 White Noise........................................................................................................................................83
103 Identifying ARMA parameters..............................................................................................83
103.1 AR(1) model........................................................................................................................................83
103.2 AR(2) model........................................................................................................................................83
103.3 Identifying ARMA parameters in practice...........................................................................................84
Proefexamen....................................................................................................................88
Opmerkingen over examen:...........................................................................................105
2e deel examen...............................................................................................................107
Dataset.....................................................................................................................................107
Multiple Linear Regression Model............................................................................................107
Model Diagnostics....................................................................................................................108
,DEEL 1: introduction to probability
4. Definitions of Probability
Waarschijnlijkheidsruimte = verzameling verschillende mogelijke gebeurtenissen
=>vertegenwoordigt ALLE mogelijke gebeurtenissen & altijd MINSTEN 1 gebeurtenis is geldig
=> kans van de ruimte zelf = 1
Kans dat een gebeurtenis zich voordoet: steeds gelegen tussen 0 en 1
Kans dat een gebeurtenis zich NIET voordoet: 1 – P(dat het zich wel voordoet)
SOM = 1
A∩B = A en B
A ∪B = A of B
5. Jeffrey’s axiom system
2 soorten waarschijnlijkheden die axiomatisch bepaald zijn
1. Gewone waarschijnlijkheden
P(C) -> C = de kans op slagen van mijn nieuw gestart bedrijf.
2. Conditionele waarschijnlijkheden
P(C/X) -> de kans dat mijn bedrijf succesvol zal zijn GEGEVEN DAT mijn partner nog
nooit een bedrijf gerund heeft
5.16 Theorem I (Bayes Theorem)
6. Bayes’ Theorem
P( B∨ A) P( A)
Stelling van Bayes P( A∨B)=
P( B)
P ( A|B ) = posterior = posterieure waarschijnlijkheid = degene die berekend wordt
P( B∨A ) = likelihood = aannemelijkheidsfunctie
P( A) en P( B) = unconditional = onvoorwaardelijke, voorafgaande waarschijnlijkheden
P( H∨D)∝ P(D∨H )P( H )
H = hypothese
D = geobserveerde data
P ( H|D )=¿waarschijnlijkheid dat de hypothese waar is, gegeven het feit dat specifieke
gegevens zijn waargenomen
∝ = varieert met
P( D∨H ) = waarschijnlijkheid van de waargenomen gegevens wanneer de hypothese waar
is P( H) = voorafgaande waarschijnlijkheid van de hypothese.
,
Table of Contents
DEEL 1: introduction to probability.....................................................................................5
4. Definitions of Probability..........................................................................................................5
5. Jeffrey’s axiom system..............................................................................................................5
5.16 Theorem I (Bayes Theorem)....................................................................................................................5
6. Bayes’ Theorem........................................................................................................................5
6.2 voorbeeld..................................................................................................................................................7
7. Sensititvity and specificity........................................................................................................7
8. Multinational Naive Bayes Classifier.........................................................................................8
8.2 voorbeeld..................................................................................................................................................8
8.3 Interactie-effecten....................................................................................................................................8
8.4 Zero probabilities......................................................................................................................................8
9. Law of large numbers...............................................................................................................8
DEEL 2: Probability Distributions........................................................................................9
11. Bernoulli distribution..............................................................................................................9
12. Binomial distribution..............................................................................................................9
13 Multinomial distributions........................................................................................................9
14. Uniforme verdeling.................................................................................................................9
15.12 Expected value....................................................................................................................................10
15.22 Random Number generator................................................................................................................10
15.24 Example...............................................................................................................................................10
15.32 Related distribution............................................................................................................................10
16. Gaussian Naive Bayes Classifier............................................................................................11
16.3 voorbeeld..............................................................................................................................................11
17.Chi-distribution – overgeslagen..............................................................................................12
18. Chi-squared Distribution.......................................................................................................12
18.1 Probability Density Function.................................................................................................................12
19 Chi-squared Distribution (2 parameters) Niet kennen...........................................................13
20 Student t-Distribution...........................................................................................................13
21 Fisher F-Distribution..............................................................................................................13
DEEL 3.1: Descriptive Statistics & Exploratory Data Analysis.............................................14
23. Types of data........................................................................................................................14
23.1 Qualitative data.....................................................................................................................................14
23.2 Quantitative data..................................................................................................................................14
25. Frequency Plot (Bar plot)......................................................................................................14
26. Frequency tabel....................................................................................................................14
27.Contingency table..................................................................................................................14
28. Binomial Classification Metrics.............................................................................................15
, 29. Confusion matrix..................................................................................................................15
30. Stem- and -leaf plot..............................................................................................................15
31. Histogram.............................................................................................................................16
32. Quantiles – kwantielen.........................................................................................................16
33. Central Tendancy - centrummaten........................................................................................16
34.17 Interquartile difference.......................................................................................................................17
34.30 Relationship between MAD, QD and s................................................................................................17
35. Skewness & kurtosis.............................................................................................................17
35.17 Example Skewness en kurtosis test....................................................................................................18
36. concentration – niet kennen.................................................................................................19
37. Notched Boxplot...................................................................................................................19
38. Scatterplot............................................................................................................................21
39. Pearson correlation...............................................................................................................22
39.5 RFC........................................................................................................................................................22
39.7 Phi coëfficiënt.......................................................................................................................................22
40. Rank correlation – rang correlatie.........................................................................................22
41. Partial Pearson correlation - Partiële pearson correlatie.......................................................22
41.5 Example.................................................................................................................................................22
42. Lineair regression - Lineaire regressie...................................................................................23
43. Moments - Momenten..........................................................................................................24
44. QQPlot..................................................................................................................................24
46. Probability Plot Correlation Coefficient Plot - PPCC Plot........................................................24
47. Kernel Density Estimation.....................................................................................................25
48 Bivariate Kernel Density Plot.................................................................................................25
49. Bootstrap Plot.......................................................................................................................25
50 Survey Scores Rank Order Comparison.................................................................................25
51. Cronbach Alpha....................................................................................................................26
DEEL 3.2 Tijdsreeksen.......................................................................................................27
52. Tijdsreeksen..........................................................................................................................27
53. Time series plot....................................................................................................................27
54. Mean plot.............................................................................................................................28
Voorbeeld 54.4.2...........................................................................................................................................28
55. Blocked Bootstrap Plot (for central tendacy).........................................................................29
56. Standard Deviation Mean Plot..............................................................................................30
57 Variance Reduction Matrix.....................................................................................................30
58. (Partiële) Autocorrelatie functie............................................................................................32
59. Periodogram & Cumulative periodogram..............................................................................32
DEEL 4: Hypothesis Testing...............................................................................................33
, Onderliggende theorie: hfdst 61 – hfdst 76.................................................................................33
62. The population – populatie...................................................................................................33
63. The sample...........................................................................................................................33
68. Centrale limiet stelling..........................................................................................................33
69. Statistical test of the population mean with known variance................................................33
69.1.3.Critical region - Software...................................................................................................................34
70. Statistical test of the population mean with unknown variance............................................39
71. Statistical test of the variance...............................................................................................39
72. Statistical test of the population proportion.........................................................................39
73. statistical test of the standard deviation...............................................................................39
74. Statistical test of the difference between means..................................................................39
78: One sample t-test.................................................................................................................39
Voorbeeld 78.2.3...........................................................................................................................................40
79. Skewness & Kurtosis test......................................................................................................41
80. Paired two sample t-test.......................................................................................................42
82. Wilcoxon Signed Rank Test....................................................................................................45
83. Unpaired two sample t-test..................................................................................................45
84. Mann-Whithney U test.........................................................................................................46
85. Bayesian two sample test.....................................................................................................46
86. Median test bases on Notched Boxplots...............................................................................46
87 Chi-squared Test for Count data.............................................................................................46
88. One Way Analysis of Variance – One Way ANOVA.................................................................47
89. Two Way Analysis of Variance...............................................................................................49
89.1.3 Output................................................................................................................................................49
90: testing correlations...............................................................................................................51
91. A Note on Causality..............................................................................................................51
DEEL 5: Regressions models..............................................................................................52
93. Simple lineair regression model............................................................................................52
93.3 Ordinary Least Squares for Simple Linear Regression..........................................................52
94. Multiple Lineair Regression Model........................................................................................52
94.1.4 Minimum Variance (Gauss-Markov Theorem)..................................................................53
94.1.7 Determination Coefficient (R2).........................................................................................53
94.1.8 Relationship between the SLRM and MLRM....................................................................53
94.2. gaan we niet doen!............................................................................................................53
95. Hypothesis Testing with Lineair Regression Models..............................................................53
Oefeningen in R-studio.....................................................................................................54
95.4 Misspecificatie van regressie...............................................................................................60
, 95.5 Multicollineariteit in regressie..............................................................................................................66
R-tutorial.........................................................................................................................67
Assingnments................................................................................................................................................67
Relational operators......................................................................................................................................68
Logical values................................................................................................................................................68
Foutmeldingen..............................................................................................................................................68
Help files.......................................................................................................................................................68
Atomic (= van hetzelfde type/ soort) vectors (= lijst van getallen, teksten, logical values, …).....................69
Recycleren.....................................................................................................................................................69
Indexing.........................................................................................................................................................69
Missing values...............................................................................................................................................69
Speciale tekens...........................................................................................................................72
DEEL 6: introduction to Time Series Analysis.....................................................................72
97 Case: the market of health and personal care products.........................................................72
DEEL 7: Box-Jenkins Analysis............................................................................................79
100 Introduction to Box-Jenkins Analysis....................................................................................79
101 Theoretical concepts............................................................................................................79
101.1 stationariteit.......................................................................................................................................79
101.2 White Noise........................................................................................................................................83
103 Identifying ARMA parameters..............................................................................................83
103.1 AR(1) model........................................................................................................................................83
103.2 AR(2) model........................................................................................................................................83
103.3 Identifying ARMA parameters in practice...........................................................................................84
Proefexamen....................................................................................................................88
Opmerkingen over examen:...........................................................................................105
2e deel examen...............................................................................................................107
Dataset.....................................................................................................................................107
Multiple Linear Regression Model............................................................................................107
Model Diagnostics....................................................................................................................108
,DEEL 1: introduction to probability
4. Definitions of Probability
Waarschijnlijkheidsruimte = verzameling verschillende mogelijke gebeurtenissen
=>vertegenwoordigt ALLE mogelijke gebeurtenissen & altijd MINSTEN 1 gebeurtenis is geldig
=> kans van de ruimte zelf = 1
Kans dat een gebeurtenis zich voordoet: steeds gelegen tussen 0 en 1
Kans dat een gebeurtenis zich NIET voordoet: 1 – P(dat het zich wel voordoet)
SOM = 1
A∩B = A en B
A ∪B = A of B
5. Jeffrey’s axiom system
2 soorten waarschijnlijkheden die axiomatisch bepaald zijn
1. Gewone waarschijnlijkheden
P(C) -> C = de kans op slagen van mijn nieuw gestart bedrijf.
2. Conditionele waarschijnlijkheden
P(C/X) -> de kans dat mijn bedrijf succesvol zal zijn GEGEVEN DAT mijn partner nog
nooit een bedrijf gerund heeft
5.16 Theorem I (Bayes Theorem)
6. Bayes’ Theorem
P( B∨ A) P( A)
Stelling van Bayes P( A∨B)=
P( B)
P ( A|B ) = posterior = posterieure waarschijnlijkheid = degene die berekend wordt
P( B∨A ) = likelihood = aannemelijkheidsfunctie
P( A) en P( B) = unconditional = onvoorwaardelijke, voorafgaande waarschijnlijkheden
P( H∨D)∝ P(D∨H )P( H )
H = hypothese
D = geobserveerde data
P ( H|D )=¿waarschijnlijkheid dat de hypothese waar is, gegeven het feit dat specifieke
gegevens zijn waargenomen
∝ = varieert met
P( D∨H ) = waarschijnlijkheid van de waargenomen gegevens wanneer de hypothese waar
is P( H) = voorafgaande waarschijnlijkheid van de hypothese.
,