Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.1 Lecture 4: Fitting distributions: goodness of fit l Goodness of fit.

Slides:



Advertisements
Similar presentations
University of Ottawa - Bio 4158 – Applied Biostatistics © Antoine Morin and Scott Findlay 11/06/2014 3:11 AM 1 Goodness of fit, contingency tables and.
Advertisements

Lecture (11,12) Parameter Estimation of PDF and Fitting a Distribution Function.
Random variable Distribution. 200 trials where I flipped the coin 50 times and counted heads no_of_heads in a trial.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L10.1 CorrelationCorrelation The underlying principle of correlation analysis.
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
CJ 526 Statistical Analysis in Criminal Justice
Bivariate Statistics GTECH 201 Lecture 17. Overview of Today’s Topic Two-Sample Difference of Means Test Matched Pairs (Dependent Sample) Tests Chi-Square.
T-Tests Lecture: Nov. 6, 2002.
Chi-square Goodness of Fit Test
1 Nominal Data Greg C Elvers. 2 Parametric Statistics The inferential statistics that we have discussed, such as t and ANOVA, are parametric statistics.
Chapter 12 Inferential Statistics Gay, Mills, and Airasian
The Chi-square Statistic. Goodness of fit 0 This test is used to decide whether there is any difference between the observed (experimental) value and.
Inferential Statistics: SPSS
The table shows a random sample of 100 hikers and the area of hiking preferred. Are hiking area preference and gender independent? Hiking Preference Area.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved Section 8-6 Testing a Claim About a Standard Deviation or Variance.
CJ 526 Statistical Analysis in Criminal Justice
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 21/09/2015 7:46 PM 1 Two-sample comparisons Underlying principles.
Chi-Square as a Statistical Test Chi-square test: an inferential statistics technique designed to test for significant relationships between two variables.
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
BIOL 582 Lecture Set 17 Analysis of frequency and categorical data Part II: Goodness of Fit Tests for Continuous Frequency Distributions; Tests of Independence.
Inquiry 1 written AND oral reports due Th 9/24 or M 9/28.
1 Statistical Distribution Fitting Dr. Jason Merrick.
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
Chi-squared Tests. We want to test the “goodness of fit” of a particular theoretical distribution to an observed distribution. The procedure is: 1. Set.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 21/10/ :24 PM 1 Review and important concepts Biological.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 23/10/2015 9:22 PM 1 Two-sample comparisons Underlying principles.
Education 793 Class Notes Presentation 10 Chi-Square Tests and One-Way ANOVA.
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Statistical Testing of Differences CHAPTER fifteen.
Chapter Outline Goodness of Fit test Test of Independence.
DTC Quantitative Methods Bivariate Analysis: t-tests and Analysis of Variance (ANOVA) Thursday 14 th February 2013.
Statistical Analysis: Chi Square AP Biology Ms. Haut.
Statistics 300: Elementary Statistics Section 11-2.
381 Goodness of Fit Tests QSCI 381 – Lecture 40 (Larson and Farber, Sect 10.1)
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L14.1 Lecture 14: Contingency tables and log-linear models Appropriate questions.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
Environmental Modeling Basic Testing Methods - Statistics II.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L11.1 Simple linear regression What regression analysis does The simple.
III. Statistics and chi-square How do you know if your data fits your hypothesis? (3:1, 9:3:3:1, etc.) For example, suppose you get the following data.
Université d’Ottawa / University of Ottawa 1999 Bio 8100s Multivariate biostatistics L5.1 Two sample comparisons l Univariate 2-sample comparisons l The.
Educational Research Inferential Statistics Chapter th Chapter 12- 8th Gay and Airasian.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 28/06/2016 4:11 PM 1 Review and important concepts.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L12.1 Lecture 12: Generalized Linear Models (GLM) What are they? When do.
Test of Goodness of Fit Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 22/11/ :12 AM 1 Contingency tables and log-linear models.
Chi Square Test Dr. Asif Rehman.
The Chi Square Test A statistical method used to determine goodness of fit Chi-square requires no assumptions about the shape of the population distribution.
The Chi-square Statistic
Distributions of Nominal Variables
DTC Quantitative Methods Bivariate Analysis: t-tests and Analysis of Variance (ANOVA) Thursday 20th February 2014  
Chapter 9: Non-parametric Tests
Lecture Nine - Twelve Tests of Significance.
Distributions of Nominal Variables
Hypothesis Testing Review
Hypothesis testing. Chi-square test
Chapter 9 Hypothesis Testing.
The Chi Square Test A statistical method used to determine goodness of fit Goodness of fit refers to how close the observed data are to those predicted.
The Chi Square Test A statistical method used to determine goodness of fit Goodness of fit refers to how close the observed data are to those predicted.
Part IV Significantly Different Using Inferential Statistics
Hypothesis testing. Chi-square test
The Chi Square Test A statistical method used to determine goodness of fit Goodness of fit refers to how close the observed data are to those predicted.
Elements of a statistical test Statistical null hypotheses
Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007
UNIT V CHISQUARE DISTRIBUTION
S.M.JOSHI COLLEGE, HADAPSAR
Skills 5. Skills 5 Standard deviation What is it used for? This statistical test is used for measuring the degree of dispersion. It is another way.
Chapter Outline Goodness of Fit test Test of Independence.
15 Chi-Square Tests Chi-Square Test for Independence
Lecture 43 Section 14.1 – 14.3 Mon, Nov 28, 2005
Presentation transcript:

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.1 Lecture 4: Fitting distributions: goodness of fit l Goodness of fit l Testing goodness of fit l Testing normality l An important note on testing normality! l Goodness of fit l Testing goodness of fit l Testing normality l An important note on testing normality!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.2 Goodness of fit l measures the extent to which some empirical distribution “fits” the distribution expected under the null hypothesis Fork length Frequency Observed Expected

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.3 Goodness of fit: the underlying principle l If the match between observed and expected is poorer than would be expected on the basis of measurement precision, then we should reject the null hypothesis. Fork length Observed Expected Frequency Reject H 0 Accept H 0

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.4 Testing goodness of fit : the Chi- square statistic (    l Used for frequency data, i.e. the number of observations/results in each of n categories compared to the number expected under the null hypothesis. Frequency Category/class Observed Expected

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.5 How to translate  2 into p? Compare to the  2 distribution with n - 1 degrees of freedom. If p is less than the desired  level, reject the null hypothesis. Compare to the  2 distribution with n - 1 degrees of freedom. If p is less than the desired  level, reject the null hypothesis  2 (df = 5) Probability  2 = 8.5, p = 0.31 accept p =  = 0.05

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.6 Testing goodness of fit: the log likelihood-ratio Chi-square statistic (G) Similar to  2, and usually gives similar results. l In some cases, G is more conservative (i.e. will give higher p values). Similar to  2, and usually gives similar results. l In some cases, G is more conservative (i.e. will give higher p values). Frequency Category/class Observed Expected

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.7  2 versus the distribution of  2 or G For both  2 and G, p values are calculated assuming a  2 distribution......but as n decreases, both deviate more and more from  2. For both  2 and G, p values are calculated assuming a  2 distribution......but as n decreases, both deviate more and more from   2 /  2 /G (df = 5) Probability  2 /G, very small n  2 /G, small n 

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.8 Assumptions (  2 and G) l n is larger than 30. l Expected frequencies are all larger than 5. l Test is quite robust except when there are only 2 categories (df = 1). For 2 categories, both X 2 and G overestimate  2, leading to rejection of null hypothesis with probability greater than  i.e. the test is liberal. l n is larger than 30. l Expected frequencies are all larger than 5. l Test is quite robust except when there are only 2 categories (df = 1). For 2 categories, both X 2 and G overestimate  2, leading to rejection of null hypothesis with probability greater than  i.e. the test is liberal.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.9 What if n is too small, there are only 2 categories, etc.? l Collect more data, thereby increasing n. l If n > 2, combine categories. l Use a correction factor. l Use another test. l Collect more data, thereby increasing n. l If n > 2, combine categories. l Use a correction factor. l Use another test. More data Classes combined

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.10 Corrections for 2 categories For 2 categories, both X 2 and G overestimate  2, leading to rejection of null hypothesis with probability greater than  i.e. test is liberal  l Continuity correction: add 0.5 to observed frequencies. Williams’ correction: divide test statistic (G or  2 ) by: For 2 categories, both X 2 and G overestimate  2, leading to rejection of null hypothesis with probability greater than  i.e. test is liberal  l Continuity correction: add 0.5 to observed frequencies. Williams’ correction: divide test statistic (G or  2 ) by:

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.11 The binomial test l Used when there are 2 categories. l No assumptions l Calculate exact probability of obtaining N - k individuals in category 1 and k individuals in category 2, with k = 0, 1, 2,... N. l Used when there are 2 categories. l No assumptions l Calculate exact probability of obtaining N - k individuals in category 1 and k individuals in category 2, with k = 0, 1, 2,... N. Number of observations Probability Binominal distribution, p = 0.5, N = 10

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.12 An example: sex ratio of beavers l H 0 : sex-ratio is 1:1, so p = 0.5 = q l p(0 males, females) = l p(1 male/female, 9 male/female) =.0195 l p(9 or more individuals of same sex) =.0215, or 2.15%. l therefore, reject H 0 l H 0 : sex-ratio is 1:1, so p = 0.5 = q l p(0 males, females) = l p(1 male/female, 9 male/female) =.0195 l p(9 or more individuals of same sex) =.0215, or 2.15%. l therefore, reject H 0

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.13 Multinomial test l Simple extension of binomial test for more than 2 categories l Must specify 2 probabilities, p and q, for null hypothesis, p + q + r = 1.0. l No assumptions......but so tedious that in practice  2 is used. l Simple extension of binomial test for more than 2 categories l Must specify 2 probabilities, p and q, for null hypothesis, p + q + r = 1.0. l No assumptions......but so tedious that in practice  2 is used.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.14 Multinomial test: segregation ratios l Hypothesis: both parents Aa, therefore segregation ratio is 1 AA: 2 Aa: 1 aa. l So under H 0, p =.25, q =.50, r =.25 l For N = 60, p <.001 l Therefore, reject H 0. l Hypothesis: both parents Aa, therefore segregation ratio is 1 AA: 2 Aa: 1 aa. l So under H 0, p =.25, q =.50, r =.25 l For N = 60, p <.001 l Therefore, reject H 0.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.15 Goodness of fit: testing normality l Since normality is an assumption of all parametric statistical tests, testing for normality is often required. Tests for normality include  2 or G, Kolmogorov-Smirnov, Wilks-Shapiro & Lilliefors. l Since normality is an assumption of all parametric statistical tests, testing for normality is often required. Tests for normality include  2 or G, Kolmogorov-Smirnov, Wilks-Shapiro & Lilliefors. Frequency Category/class Observed Expected under hypothesis of normal distribution

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.16 Cumulative distributions l Areas under the normal probability density function and the cumulative normal distribution function  2.28% 50.00% 68.27% F Normal probability density function Cumulative normal density function

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.17  2 or G test for normality l Put data in classes (histogram) and compute expected frequencies based on discrete normal distribution. Calculate  2. l Requires large samples (k min = 10) and is not powerful because of loss of information. l Put data in classes (histogram) and compute expected frequencies based on discrete normal distribution. Calculate  2. l Requires large samples (k min = 10) and is not powerful because of loss of information. Observed Expected under hypothesis of normal distribution Frequency Category/class

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.18 “Non-statistical” assessments of normality l Do normal probability plot of normal equivalent deviates (NEDs) versus X. l If line appears more or less straight, then data are approximately normally distributed. l Do normal probability plot of normal equivalent deviates (NEDs) versus X. l If line appears more or less straight, then data are approximately normally distributed. NEDs X Normal Non-normal

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.19 Komolgorov-Smirnov goodness of fit l Compares observed cumulative distribution to expected cumulative distribution under the null hypothesis. l p is based on D max, absolute difference, between observed and expected cumulative relative frequencies. l Compares observed cumulative distribution to expected cumulative distribution under the null hypothesis. l p is based on D max, absolute difference, between observed and expected cumulative relative frequencies. D max X Cumulative frequency

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.20 An example: wing length in flies l 10 flies with wing lengths: 4, 4.5, 4.9, 5.0, 5.1, 5.3, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0 l cumulative relative frequencies:.1,.2,.3,.4,.5,.6,.7,.8,.9, 1.0 l 10 flies with wing lengths: 4, 4.5, 4.9, 5.0, 5.1, 5.3, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0 l cumulative relative frequencies:.1,.2,.3,.4,.5,.6,.7,.8,.9, 1.0 Wing length Cumulative frequency D max

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.21 Lilliefors test l KS test is conservative for tests in which the expected distribution is based on sample statistics. l Liliiefors corrects for this to produce a more reliable test. l Should be used when null hypothesis is intrinsic versus extrinsic. l KS test is conservative for tests in which the expected distribution is based on sample statistics. l Liliiefors corrects for this to produce a more reliable test. l Should be used when null hypothesis is intrinsic versus extrinsic.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L4.22 An important note on testing normality! l When N is small, most tests have low power. l Hence, very large deviations are required in order to reject the null. l When N is large, power is high. l Hence, very small deviations from normality will be sufficient to reject the null. l So, exercise common sense! l When N is small, most tests have low power. l Hence, very large deviations are required in order to reject the null. l When N is large, power is high. l Hence, very small deviations from normality will be sufficient to reject the null. l So, exercise common sense!