220 likes | 472 Views
BIOL 582. Lecture Set 2 Inferential Statistics, Hypotheses, and Resampling. BIOL 582. Inferential Statistics. Statistics we have already learned (e.g., mean, variance, standard deviation) are descriptive statistics.
E N D
BIOL 582 Lecture Set 2 Inferential Statistics, Hypotheses, and Resampling
BIOL 582 Inferential Statistics • Statistics we have already learned (e.g., mean, variance, standard deviation) are descriptive statistics. • Statistics that are tests for specific patterns in data using independent variables to generate hypotheses (Y vs. X) are inferential statistics (e.g., t-test, ANOVA, likelihood ratio tests). • Procedure: • Obtain an observed condition • Compare observed condition to distribution of expected values (or their likelihood) • Determine whether observed value is something interesting (i.e., it is unexpected relative to chance?)
BIOL 582 Inferential Statistics Observed value probability • Inferential statistics compare observed value to distribution of ‘expected’ values • Significance determined based upon how ‘extreme’ the observed value is relative to the distribution • Resampling methods are one approach for generating expected distributions Side Trip to learn about probability…
BIOL 582 Variant of the Fisher Exact Test Is this meaningful? Sir Ronald Aylmer Fisher (1890 –1962) Fisher’s exact test (named after Fisher for work he originally published in 1922, but also published in other ways after
BIOL 582 Variant of the Fisher Exact Test Sir Ronald Aylmer Fisher (1890 –1962) Fisher’s exact test (named after Fisher for work he originally published in 1922, but also published in other ways after Consider all possible ways to get 2 groups of 4 with these data m permutations; n values; g number of groups 28 possible ways to get 2 groups of 4!
BIOL 582 Variant of the Fisher Exact Test Sir Ronald Aylmer Fisher (1890 –1962) Fisher’s exact test (named after Fisher for work he originally published in 1922, but also published in other ways after Observed Random Do this for all 28 possible permutations and create a distribution of differences
BIOL 582 Variant of the Fisher Exact Test 2 ways to get 2.5 Sir Ronald Aylmer Fisher (1890 –1962) Fisher’s exact test (named after Fisher for work he originally published in 1922, but also published in other ways after 2/28 = 0.07 = probability of getting 2.5 from randomly sampling two groups from the same population 28 possible absolute differences in averages between two groups
BIOL 582 Resampling Enumerating all possible permutations becomes challenging for large data sets, several groups, and uneven group sizes. Table to the right shows the number of permutations needed for two equal sized groups • We can use resampling methods instead! • Methods that take many samples from original data set in some specified way and evaluate the significance of the original based on these samples • Approaches are nonparametric, because they generate a distribution from the data • Are very flexible, and can allow for complicated designs • Major variants: randomization, bootstrap, jackknife, Monte Carlo
BIOL 582 Resampling • Fisher’s exact test: a total enumeration of possible pairings of data (designed for contingency tables) • Randomization can be used as a proxy (but for most any test statistic) • Protocol • Calculate observed statistic (e.g., ): Eobs • Reorder data set (i.e. randomly shuffle data) and recalculate statistic Erand • Repeat for all possible combinations and generate distribution of possible statistics • Percentage of Erand more extreme than Eobs is significance level • Note: Eobs is treated as an iteration Eobs Erand Eobs
BIOL 582 Resampling • Although it may not be feasible to consider all possible permutations, empirical and theoretical statistical research has shown that using MANY (e.g., > 1,000) random permutations works well. • More specifically, the mean value obtained from the distribution of random values generally converges on the expected value for the NULL hypothesis. Eobs Erand Eobs
BIOL 582 Null Hypotheses • What is a null hypothesis? • In general, it’s the hypothesis that states “no relationship”, or “no difference”, which can be tested with evidence (data). If results from a hypothesis test support an alternative hypothesis (i.e., there is a relationship, or there is a difference), then the null hypothesis is rejected. • The expected value for a null hypothesis states something about the population from which data are collected. It usually is presented as a difference equal to 0.
BIOL 582 Null Hypotheses Example: Imagine collecting a sample of 10 treefrogs from the Green River Biopreserve. The snout-to-vent length (SVL) is measured for each, and the sample mean is calculated. The sample mean is an estimate of the unknown, but existent, population mean. Go out and repeat the procedure. What is the expected difference in sample means between the two samples? Answer: 0 Why: If the sample mean is an estimate of the population mean, and it’s accurate, then the difference in sample means should be the difference between the population mean and itself, which is 0!
BIOL 582 Null Hypotheses But there has to be some sort of expected error in sampling! A Null Hypothesis (H0): µA = µB ; or µA - µB = 0 H0 implies that if the two population means are not different, sampling from both is tantamount to sampling from one. Two samples collected from two populations B Important point: if two samples have parameter estimates that “behave” as if from one population, then randomly shuffling values between samples should indicate that the observed difference is not uncommon. If the sample parameter estimates are quite different, then the observed case should be rare compared to randomly shuffling values between samples. The best way to demonstrate this is with a physical example. Go to R
BIOL 582 The Language of Hypothesis Testing Notice that the confidence intervals of the means overlap 10 15 20 25 30 35 40 45 • (1 – α)% Confidence intervals α is the accepted type I error rate (more later) • E.g., a 95% Confidence interval is the distribution of values between 2.5 and 97.5 percentiles • Imagine two confidence intervals from different populations (or samples): • 25 +/- 10 • 35 +/- 5 • Are the means different? Question: do the populations have different means?
BIOL 582 The Language of Hypothesis Testing Hypothesis testing: • Steps in Hypothesis Testing • A claim is made. • Evidence (sample data) is collected in order to test the claim. • The data are analyzed in order to support or refute the claim. Hypothesis testing is a procedure, based on sample evidence and probability, used to test claims regarding a characteristic of one or more populations. The null hypothesis, denoted H0, is a statement to be tested. The null hypothesis is assumed true until evidence indicates otherwise. It is a statement regarding the value of a population parameter. The alternative hypothesis, denoted Ha, is a claim to be tested. We are trying to find evidence for the alternative hypothesis. It is a claim about a population parameter.
BIOL 582 The Language of Hypothesis Testing Hypothesis testing: • There are several ways to test a null hypothesis: • 1. Equal hypothesis versus not equal hypothesis (two-sided test) • H0: parameter = some value • Ha: parameter some value • 2. Equal hypothesis versus less than (one-sided test) • H0: parameter = some value • Ha: parameter < some value • 3. Equal hypothesis versus greater than (one-sided test) • H0: parameter = some value • Ha: parameter > some value
BIOL 582 The Language of Hypothesis Testing Hypothesis testing: • When we test a hypothesis, there are four possible outcomes: • Four Outcomes from Hypothesis Testing • We reject the null when in fact the alternative is true. This decision would be correct. • We fail to reject the null when in fact the null is true. This decision would be correct. • We reject the null when in fact the null is true. This decision would be incorrect. This type of error is called a Type I error. • We fail to reject the null when in fact the alternative is true. This decision would be incorrect. This type of error is called a Type II error.
BIOL 582 The Language of Hypothesis Testing Hypothesis testing: • Think about the Judicial Process: • A person is innocent until proven guilty…. • Thus, • H0: defendant is innocent • Ha: defendant is guilty • We have four possible outcomes: • The defendant is innocent and found to be innocent (i.e., null is true and the hypothesis test did not reject the null hypothesis). • The defendant is guilty and found to be guilty (i.e., null is false and the hypothesis test rejects the null hypothesis). • The defendant is really innocent but found to be guilty and sent to jail (Type I error). • The defendant is really guilty but found to be innocent and set free (Type II error).
BIOL 582 The Language of Hypothesis Testing Hypothesis testing: We may want to know the probability of making a Type I or Type II error. : The probability of making a Type I error (called the level of significance)* : The probability of making a Type II error. * can be associated with empirical percentiles or associated with the tails of a theoretical distributions, such as standard normal or t-distribution. In both cases, it represents the probability of finding a value lower or higher than the confidence limits we describe (e.g., = 0.10 means we assume a 10% probability of finding a value outside of our confidence limits). In hypothesis testing, is the probability of finding a value outside a range that is associated with the null hypothesis.
BIOL 582 The Language of Hypothesis Testing What kind of hypothesis tests can we learn? … we could systematically go through a bunch and learn them well, and learn in what situations to use them…. BORING! We will instead learn methods important to us (like linear models) and consider how to test hypotheses that are important
BIOL 582 Testing a Hypothesis • Regardless, the following steps are useful to remember in hypothesis tests • State the null and alternative hypotheses. • Select the level of significance, . • Calculate the test statistic (e.g., Z value, t statistic, SS, means contrast, Λ2) • Compare either • The critical value of the test statistic with the observed test statistic. • The observed statistic to a distribution of random statistics • State the conclusion. • If the probability of finding a random statistic that exceeds the value of a test statistic associated with , is lower than , one rejects the null hypothesis • In other words, if a chance outcome is rarer than our comfort level, we believe the null hypothesis is falsified.
BIOL 582 Testing a Hypothesis Now, let’s play with some data and see how this works. As we do, either on a notepad, or a document on your computer screen, always provide the following information for any test: H0: Ha: α: Reject H0:? Conclusion: