Download presentation
Presentation is loading. Please wait.
Published byBrooke Harvey Modified over 9 years ago
1
1 Statistics Achim Tresch Gene Center LMU Munich
2
2
3
3 Pope Benedikt XVI Andrej Kolmogoroff Two ways of dealing with uncertainty
4
4 Topics I.Descriptive Statistics II.Test theory III. Common tests IV. Bivariate Analysis V.Regression
5
5 I. Description Tables Figures and graphical presentation Interpretation „If you don‘t know, you have to believe“ Pan Tau „I strongly believe the Irak owns weapons of mass destruction“ George W. Bush
6
6 What is „data“? Cases (Samples, Observations)Endpoints (Variables)Realizations (instances,values) … The sample/ the sample population ⊆ population A collection of observations of a similar structure
7
7 Different Scales of a Variable Categorial Variables Have only a finite number of instances: Male/female; Mon/Tue/…/Sun Continuous Variables Can take values in an interval of the real numbers E.g. blood pressure [mmHg], costs [€] Nominal data: Categorial variables without a given order E.g. eye color [brown, blue, green, grey] Special Case: Binary (=dichotomic) variables (yes/no, 0/1…) Ordinal data: Instances are ordered in a natural way E.g. tumor grade [I, II, III, IV], rank in a contest (1,2,3,…)
8
8 85% shinier hair! I. Description Problem: It is often difficult to map a variable to an appropriate scale: E.g. happiness, pain, satisfaction, social status, anger -> Check whether your choice of scale is meaningful!
9
9 Value ABAB0 (absolute) frequency 83201075188 relative frequency 44%11%5%40%100% Always list absolute frequencies! Do not list relative frequencies in percent if the sample size is small (n < 20) Do not use decimal digits in percent numbers for n<300 „Side effects were observed in 14,2857% of all cases“ Nonsense, we conclude that n=7! Description of a categorial variable: Tables Example: Blood antigens (ABO), n = 188 samples I. Description
10
10 % Description of a categorial variable: Barplot I. Description
11
11 Description of continuous data: Histogram I. Description
12
12 The size of the bins (= width of the bars) is a matter of choice and has to be determined sensibly! 50 bins 4 Balken 12 bins I. Description
13
13 Caution: Data will be smoothed automatically. This is very suggestive and blurs discontinuities in a distribution. I. Description Description of continuous data: Density plot
14
14 The most important one: The Gaussian (normal) distribution Expectation value Standard- deviation I. Description C.F Gauss (1777-1855): Roughly speaking, continuous variables that are the (additive) result of a lot of other random variables follow a Gaussian distribution. -> It is often sensible to assume a gaussian distribution for continuous variables.
15
15 Measures of Location, Scale and Scatter Mean: sum of all observations / number of samples Ex.: observations: 2, 3, 7, 9, 14 sum: 2+3+7+9+14 = 35 # observations: 5 Mean: 35/5 = 7 Median: A number M such that 50% of all observations are less than or equal to M, and 50% are greater than or equal to M. (Q: What if #observations is even?) 50% I. Description
16
Mode: A value for which the density of the variable reaches a local maximum. If there is only one such value, the distribution is called unimodal, otherwise multimodal. Special case: bimodal) 16 Mean Median I. Description Description of Location, Scale and Scatter
17
17 Distribution Shapes Symmetric Mean Median Skewed to the right Median << Mean Skewed to the left Mean << Median I. Description
18
18 The median should be preferred to the mean if the ditribution is very asymmetric there are extreme outliers The skewness g of the distribution ranges between –1 und +1, i.e. the distribution is approx. symmetric. skewness g > 0 skewness g < 0 The mean is more „precise“ than the median if the distribution is approximately normal Rule of thumb: Right skew: Left skew: I. Description
19
19 How would you describe this distribution? I. Description
20
20 „…it showed a giant boa swallowing an elephant. I painted the inside of the boa to make it visible to the adults. They always need explanations.“ Antoine de Saint-Exupéry, Le petit prince Unexpected distributions have unexpected causes! I. Description
21
21 More Location measures Quantile: A q-quantile Q (0≤q≤1) splits the data into a fraction of q points below or equal to Q and a fraction of 1-q points above or equal to Q. 50% Median = 50%-quantile 25% 1.quartile = 25%-quantile 25% 3.quartile = 75%-quantile 1-quantile = maximum 0-quantile = minimum I. Description
22
22 The five-point Summary and the Boxplot I. Description
23
23 Span: Maximum - Minimum Interquartile range (IQR): 3. quartile - 1. quartile Mesures of Variation I. Description
24
24 How far do the observations scatter around their „center“(=measure of location)? Measures of Variation large variation small variation Location measure e.g.: location = Median variation = 3.Quartil – 1.Quartil = Interquartilabstand (IQR) I. Description
25
25 Measures of Variation e.g.: location = median variation = mean deviation (MD) from = e.g.: location = median variation = (median absolute deviation,MAD) from I. Description
26
26 Mean ± s contains ~68% of the data Mean ± 2s ´´ ~95% ´´ Mean ± 3s ´´ ~99.7% ´´ x-s x x+s Measures of Variation Numbers for Gaussian variables: z.B.: location = mean variation = mean squared deviation from = =variance (v) Or:variation = square root of the variance = standard deviation (s, std.dev) I. Description
27
27 Histogram/Density Plot vs. Boxplot Boxplot contains less information, but it is easier to interpret. I. Description 1 3 2 4
28
28 Multiple Boxplots I. Description Sample: 2769 schoolchildren
29
29 Always report the sample size! a)numerical Median, Q 1, Q 3, Min., Max. (5-summary) for symmetric distr. alternatively: mean, standard deviation b)graphical Boxplots, histograms and/or density plots c) verbal e.g. „Blood pressure was reduced by 12 mmHg (Interquartile range: 8 to 18 mmHg = 10mmHg), whereas the reduction in the placebo group was only 3 mmHg (IQR: –2 to 4 mmHg = 6mmHg).“ Summary I. Description
30
30 Cross Table PersonMedicationResponse AVerumyes BPlacebono Two categorial variables: Cross Tables Data I. Description
31
31 Cross Table values of variable 2 values of variable 1 (potential causes) (potential effects) I. Description Two categorial variables: Cross tables PersonMedicationResponse AVerumyes BPlacebono Data
32
32 Cross Table Response yesno Medi- cation Verum Placebo values of variable 2 values of variable 1 (potential causes) (potential effects) Each case is one count in the table I. Description Two categorial variables: Cross tables PersonMedicationResponse AVerumyes BPlacebono Data
33
33 Cross Table Response yesno Medi- cation Verum10 Placebo01 values of variable 2 values of variable 1 (potential causes) (potential effects) I. Description Two categorial variables: Cross tables Each case is one count in the table PersonMedicationResponse AVerumyes BPlacebono Data
34
34 Cross Table Response yesno Medi- cation Verum10 Placebo01 values of variable 2 values of variable 1 (potential causes) (potential effects) The most common question is: Are there differences between █ and █ ? I. Description Two categorial variables: Cross tables
35
35 Absolute number, row-, column percent Response Total yesno Medi- cation Verum 20 50%, 67% 20 50%, 40% 40 50% Placebo 10 25%, 33% 30 75%, 60% 40 50% Total30, 37%50, 63%80, 100% Cross Table: n = 80 cases I. Description Two categorial variables: Cross tables
36
36 What‘s bad about this table? I. Description Two categorial variables: Cross tables
37
37 Cross tables: Independent vs. paired data independent data paired data PersonMedicationResponse AVerumyes BPlacebono PersonMedic.: VerumMedic.: Placebo Ayes B no Paired data: One object (or two closely related objects) serves for the measurement of two variables of the same kind. Exercise: The influence of diet on body height is assessed in 1) a study with 100 randomly picked subjects. 2) a study with 50 identical twins that grew up separately. Write down the cross tables. Which study is probably more informative? I. Description
38
38 Cross Table Medic.: Placebo yesno Medic.: Verum yes11 no00 values of variable 2 values of variable 1 I. Description Cross tables: Paired data paired data PersonMedic.: VerumMedic.: Placebo Ayes B no
39
39 Kreuztabelle Medic.: Placebo yesno Medic.: Verum yes11 no00 values of variable 2 values of variable 1 A typical question is: concordant observations discordant observations Are the observations concordant or discordant? Is there a particularly large number in █ or █ ? I. Description Cross tables: Paired data
40
40 Measure in the sample Measure in the population? Variance? Confidence intervals? Estimation, Regression: I. Description Difference in the sample Difference in the population? Probability of a false call? Significance Testing: Induction from the sample to the population
41
41 What allows us to conclude from the sample to the population? The sample has to be representative (figures about drug abuse of students cannot be generalized to the whole population of Germany) How is representativity achieved? Large sample numbers Random recruitment of samples from the population E.g.: Dial a random phone number. Choose a random name from the register of birth (Advantages/Disadv.?) Randomization: Random allocation of the samples to the different experimental groups I. Description
42
42 Confidence intervals 95%-Confidence interval: An estimated interval which contains the „true value“ of a quantity with a probability of 95%. 24,3 ____________________________________ () 20.529,5 X Interval estimate Point estimate (e.g. % votes for the SPD in the EU elections) ( 1 – α ) – Conficence interval: An estimated interval which contains the „true value“ of a quantity with a probability of (1 – α). 1 – α = confidence level, α = error probability Use confidence intervals with caution! I. Description
43
43 A non-sheep detector Training:Measure the length of all sheep that cross your way II. Testing
44
44 Training:Measure the length of all sheep that cross your way. Determine the distribution of the quantity of interest. A non-sheep detector II Testing
45
45 Test phase: For any unknown animal, test the hypothesis that it is a sheep. Measure ist length and compare it to the learned length distribution of the sheep. If its length is „out of bounds“, the animal will be called a non-sheep (rejection of the hypothesis). Otherwise, we cannot say much (non-rejection). A non-sheep detector Not a sheep II Testing
46
46 Advantage of the method: One does not need to know much about sheep. Disadvantage: It produces errors… True Negatives Negatives calls Positive calls Decision boundary True Positives False Positives False Negatives II Testing A non-sheep detector
47
47 Statistical Hypothesis Testing State a null hypothesis H 0 („nothing happens, there is no difference…“) Choose an appropriate test statistic (the data- derived quantity that finally leads to the decision) This implicitly determines the null distribution (the distribution of the test statistic under the null hypothesis). II Testing
48
48 Statistical Hypothesis Testing Stats an alternative hypothesis (e.g. „the test statistic is higher than expected under the null hypothesis“) Determine a decision boundary. This is equivalent to the chioce of a significance level α, i.e. the fraction of false positive calls you are willing to accept. α d II Testing Acceptance region Rejection region
49
49 Statistical Hypothesis Testing α d Calculate the actual value of the test statistic in the sample, and make your decision according to the prespecified(!) decision boundary. Keep H 0 (no rejection) Reject H 0 (assume the alternative hypothesis) II Testing
50
50 0 d Good statistic Good test statistics, bad test statistics Accept null hypothesis Reject null hypothesis Null hypothesis is true right decision Typ I error (False Positive) Alternative is true Typ II error (False Negative) right decision Distribution of the test statistic under the null hypothesis Distribution of the test statistic under the alternative hypothesis II Testing
51
0 d Bad statistic II Testing Distribution of the test statistic under the null hypothesis Distribution of the test statistic under the alternative hypothesis Accept null hypothesis Reject null hypothesis Null hypothesis is true right decision Typ I error (False Positive) Alternative is true Typ II error (False Negative) right decision Good test statistics, bad test statistics
52
52 The Offenbach Oracle Throw the 20-sided die Score = 20: reject the null hypothesis Score ≠ 20: keep the null hypothesis This is (independent of the null hypothesis) a valid statistical test at a 5% type I error level! Toni, 29, Offenbach, mechanician and moral philosopher II Testing
53
53 The Offenbach Oracle But: The distribution of the test statistic under null- and alternative hypothesis is identical This test cannot discriminate between the two alternatives! Distribution under H 0 Distribution under H 1 95% of the Positives (as well as the Negatives) will be missed. II Testing
54
54 The p-value p = 0.08 Given a test statistic and ist actual value t in a sample, a p-Wert can be calculated: Each test value t maps to a p-value, the latter is the probability of observing a value of the test statistic which is at least as extreme as the actual value t [under the assumption of the null hypothesis]. t=4.2 II Testing
55
55 p = 0.42 t=0.7 II Testing The p-value Given a test statistic and ist actual value t in a sample, a p-Wert can be calculated: Each test value t maps to a p-value, the latter is the probability of observing a value of the test statistic which is at least as extreme as the actual value t [under the assumption of the null hypothesis].
56
56 Test decisions according to the p-value Decision boundary d significance level α Observed test statistic t p-value α = 0.05 p ≥ α Keep H 0 (no rejection) p < α Reject H 0 (assume the alternative hypothesis) t p = 0.02 d t p = 0.83 t more extreme than d p is smaller than α II Testing
57
57 One- and two-sided hypotheses ][ Acceptance region Rejection region One-sided alternative H 0 : The value of a quantity of interest in group A is not higher than in group B. H 1 :The value of a quantity of interest in group A is higher than in group B. II Testing
58
58 ][ Acceptance region Rejection region H 0 : The quantity of interest has the same value in group A and group B H 1 :The quantity of interest is different in group A and group B ][ Rejection region Generally, two-sided alternatives are more conservative: Deviations in both directions are detected. II Testing One- and two-sided hypotheses Two-sided alternative
59
59 Example “Testing”: Colon Carcinoma How about this fact? Variable: Vaccine Scale: binary Endpoint: 4-year survival Scale: binary 32*94 ≈ 30 (62-32)*77 ≈ 23 II Testing
60
60 Interesting questions: Das the vaccine yield any effect? Is this effect „significant“ ? 4-year survival JaNein Vaccine yes (n=32)30 (94%)2 (6%) no (n=30)23 (77%)7 (23%) II Testing Example “Testing”: Colon Carcinoma
61
61 Null hypothesis H 0 : Vaccination has not (either positive or negative) impact on the patients. The survival rates in the vaccine and non-vaccine group in the whole population are the same. Alternative hypothesis H 1 : For the whole population, the survival rates in the vaccine and non vaccine group are different. Choose the significance level α (usually: α = 1%; 0.1%; 5%) Interpretation of the significane level α : If there is no difference between the groups, one obtains a false positive result with a probability of α. II Testing Example “Testing”: Colon Carcinoma
62
62 Choice of test statistic: „Fisher‘s Exact Test“ Sir Ronald Aylmer Fisher, 1890-1962 Theoretical Biology, Evolution Theory, Statistics II Testing Example “Testing”: Colon Carcinoma
63
63 Value of the test statistic t after the experiment has been carried out. This value can be converted into a p-value: p = 0.0766 7.7% Since we have chosen a significane level α = 5%, and p > α, we cannot reject the null hypothesis, thus we keep it. Formulation of the result: At a 5% significance level (and using Fisher‘s Exact Test), no significant effect of vaccination on survival could be detected. Consequence: We are not (yet) sufficiently convinced of the utility of this therapy. But this does not mean that there is no difference at all! II Testing Example “Testing”: Colon Carcinoma
64
64 “No test based upon the theory of probability can by itself provide any valuable evidence of the truth or falsehood of a hypothesis.“ Neyman J, Pearson E (1933) Phil Trans R Soc A Egon Pearson (1895-1980) Jerzy Neyman (1894-1981) Non-significance ≠ equivalence Statistics can never prove a hypothesis, it can only provide evidence II Testing
65
65 End of Part I
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.