Elementary hypothesis testing

Slides:



Advertisements
Similar presentations
Introductory Mathematics & Statistics for Business
Advertisements

“Students” t-test.
Hypothesis testing Another judgment method of sampling data.
Lecture (11,12) Parameter Estimation of PDF and Fitting a Distribution Function.
CmpE 104 SOFTWARE STATISTICAL TOOLS & METHODS MEASURING & ESTIMATING SOFTWARE SIZE AND RESOURCE & SCHEDULE ESTIMATING.
Chapter 12 Tests of Hypotheses Means 12.1 Tests of Hypotheses 12.2 Significance of Tests 12.3 Tests concerning Means 12.4 Tests concerning Means(unknown.
1 1 Slide STATISTICS FOR BUSINESS AND ECONOMICS Seventh Edition AndersonSweeneyWilliams Slides Prepared by John Loucks © 1999 ITP/South-Western College.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 9 Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and.
Significance Testing Chapter 13 Victor Katch Kinesiology.
Copyright © Cengage Learning. All rights reserved. 9 Inferences Based on Two Samples.
Maximum likelihood (ML) and likelihood ratio (LR) test
Hypothesis testing Some general concepts: Null hypothesisH 0 A statement we “wish” to refute Alternative hypotesisH 1 The whole or part of the complement.
PSY 307 – Statistics for the Behavioral Sciences
Sample size computations Petter Mostad
Elementary hypothesis testing
9-1 Hypothesis Testing Statistical Hypotheses Statistical hypothesis testing and confidence interval estimation of parameters are the fundamental.
Maximum likelihood (ML) and likelihood ratio (LR) test
Elementary hypothesis testing Purpose of hypothesis testing Type of hypotheses Type of errors Critical regions Significant levels Hypothesis vs intervals.
Inferences About Means of Single Samples Chapter 10 Homework: 1-6.
BCOR 1020 Business Statistics Lecture 21 – April 8, 2008.
Inference about a Mean Part II
Elementary hypothesis testing Some distributions related to normal distribution Purpose of hypothesis testing Types of hypotheses Types of errors Critical.
Inferences About Process Quality
Chapter 9 Hypothesis Testing.
5-3 Inference on the Means of Two Populations, Variances Unknown
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 8 Tests of Hypotheses Based on a Single Sample.
Hypothesis Testing and T-Tests. Hypothesis Tests Related to Differences Copyright © 2009 Pearson Education, Inc. Chapter Tests of Differences One.
Chapter 9 Title and Outline 1 9 Tests of Hypotheses for a Single Sample 9-1 Hypothesis Testing Statistical Hypotheses Tests of Statistical.
Variance-Test-1 Inferences about Variances (Chapter 7) Develop point estimates for the population variance Construct confidence intervals for the population.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 9 Hypothesis Testing.
Overview Definition Hypothesis
8 - 1 © 2003 Pearson Prentice Hall Chi-Square (  2 ) Test of Variance.
Fundamentals of Hypothesis Testing: One-Sample Tests
1/2555 สมศักดิ์ ศิวดำรงพงศ์
Review of Statistical Inference Prepared by Vera Tabakova, East Carolina University ECON 4550 Econometrics Memorial University of Newfoundland.
Copyright © Cengage Learning. All rights reserved. 13 Linear Correlation and Regression Analysis.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on the Least-Squares Regression Model and Multiple Regression 14.
The paired sample experiment The paired t test. Frequently one is interested in comparing the effects of two treatments (drugs, etc…) on a response variable.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Statistical Inferences Based on Two Samples Chapter 9.
Today’s lesson Confidence intervals for the expected value of a random variable. Determining the sample size needed to have a specified probability of.
1 Power and Sample Size in Testing One Mean. 2 Type I & Type II Error Type I Error: reject the null hypothesis when it is true. The probability of a Type.
1 CSI5388: Functional Elements of Statistics for Machine Learning Part I.
9-1 Hypothesis Testing Statistical Hypotheses Definition Statistical hypothesis testing and confidence interval estimation of parameters are.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 9 Inferences Based on Two Samples.
10.2 Tests of Significance Use confidence intervals when the goal is to estimate the population parameter If the goal is to.
Statistical Hypotheses & Hypothesis Testing. Statistical Hypotheses There are two types of statistical hypotheses. Null Hypothesis The null hypothesis,
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © Dr. John Lipp.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 8 Hypothesis Testing.
Lecture 9 Chap 9-1 Chapter 2b Fundamentals of Hypothesis Testing: One-Sample Tests.
Interval Estimation and Hypothesis Testing Prepared by Vera Tabakova, East Carolina University.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Section 9-1 Review and Preview.
1 9 Tests of Hypotheses for a Single Sample. © John Wiley & Sons, Inc. Applied Statistics and Probability for Engineers, by Montgomery and Runger. 9-1.
Sampling and Statistical Analysis for Decision Making A. A. Elimam College of Business San Francisco State University.
Statistical Inference Statistical inference is concerned with the use of sample data to make inferences about unknown population parameters. For example,
Copyright © 1998, Triola, Elementary Statistics Addison Wesley Longman 1 Assumptions 1) Sample is large (n > 30) a) Central limit theorem applies b) Can.
Review of Statistical Inference Prepared by Vera Tabakova, East Carolina University.
Chapter 12 Tests of Hypotheses Means 12.1 Tests of Hypotheses 12.2 Significance of Tests 12.3 Tests concerning Means 12.4 Tests concerning Means(unknown.
Hypothesis Tests u Structure of hypothesis tests 1. choose the appropriate test »based on: data characteristics, study objectives »parametric or nonparametric.
Statistical Inference for the Mean Objectives: (Chapter 8&9, DeCoursey) -To understand the terms variance and standard error of a sample mean, Null Hypothesis,
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 7 Inferences Concerning Means.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
4-1 Statistical Inference Statistical inference is to make decisions or draw conclusions about a population using the information contained in a sample.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Chapter 9 Hypothesis Testing.
Chapter 5 STATISTICAL INFERENCE: ESTIMATION AND HYPOTHESES TESTING
Hypothesis Testing: Hypotheses
Chapter 9 Hypothesis Testing.
9 Tests of Hypotheses for a Single Sample CHAPTER OUTLINE
Chapter 9 Hypothesis Testing.
Presentation transcript:

Elementary hypothesis testing Purpose of hypothesis testing Type of hypotheses Type of errors Critical regions Significant levels Power of tests Hypothesis vs intervals R commands for tests

Purpose of hypothesis testing Statistical hypotheses are in general different from scientific ones. Scientific hypotheses deal with the behavior of scientific subjects such as interactions between all particles in the universe. These hypotheses in general cannot be tested statistically. Statistical hypotheses deal with the behavior of observable random variables. These are hypotheses that are testable by observing some set of random variables. They are usually related to the distribution(s) of observed random variables. For example if we have observed two sets of random variables x=(x1,x2,,,,xn) and y=(y1,y2,,,,ym) then one natural question arises: are means of these two sets are different? It is a statistically testable hypothesis. Another question may arise do these two sets of random variables come from the population with the same variance? Or do these distribution come from the populations with the same distribution? These questions can be tested using observed samples.

Types of hypotheses Hypotheses can in general be divided into two categories: a) parametric and b) non-parametric. Parametric hypotheses concern with situations when the distribution of the population is known. Parametric hypotheses concern with the value of one or several parameters of this distribution. Non-parametric hypotheses concern with situations when none of the parameters of the distribution is specified in the statement of the hypothesis. For example hypothesis that two sets of random variables come from the same distribution is non-parametric one. Parametric hypotheses can also be divided into two families: 1) Simple hypotheses are those when all parameters of the distribution are specified. For example hypothesis that set of random variables comes from normal distribution with known variance and known mean is a simple hypothesis 2) Composite hypotheses are those when some parameters of the distribution are specified and others remain unspecified. For example hypothesis that set of random variables comes from the normal distribution with a given mean value but unknown variance is a composite hypothesis.

Errors in hypothesis testing Hypothesis is usually not tested alone. It is tested against some alternative one. Hypothesis being tested is called the null-hypothesis and denoted by H0 and alternative hypothesis is denoted H1. Subscripts may be different and reflect nature of the alternative hypothesis. Null-hypothesis gets “benefit of doubt”. There are two possible conclusions: reject null-hypothesis or not-reject null-hypothesis. H0 is only rejected if sample data contains sufficiently strong evidence that it is not true. Usually testing of hypothesis comes to verification of some test statistic (function of the sample points). If this value belongs to some region w hypothesis is rejected.. This region is called critical region. The region complementary to the critical region that is equal to W-w is called acceptance region. By rejecting or accepting hypothesis we can make two types of errors: Type I error: Reject H0 if it is true Type II error: Accept H0 when it is false. Type I errors usually considered to be more serious than type II errors. Type I errors define significance levels and Type II errors define power of the test. In ideal world we would like to minimize both of these errors.

Power of a test The probability of Type I error is equal to the size of the critical region, . The probability of the type II error is a function of the alternative hypothesis (say H1). This probability usually denoted by . Using notation of probability we can write: Where x is the sample points, w is the critical region and W-w is the acceptance region. If the sample points belongs to the critical region then we reject the null-hypothesis. Above equations are nothing else than Type I and Type II errors written using probabilistic language. Complementary probability of Type II error, 1- is also called the power of the test of the null hypothesis against the alternative hypothesis.  is the probability of accepting null-hypothesis if alternative hypothesis is true and 1- is the probability of rejecting H0 if H1 is true Power of the test is the function of the alternative hypothesis specification of H1. It is usual to use test statistics instead of sample points to define critical region and significance levels.

Critical region Let us assume that we want to test if some parameter of the population is equal to a given value against alternative hypothesis. Then we can write: Test statistic is usually a point estimation for  or somehow related to it. If critical region defined by this hypothesis is an interval (-;cu] then cu is called the critical value. It defines upper limit of the critical interval. All values of the statistic to the left of cu leads to rejection of the null-hypothesis. If the value of the test statistic is to the right of cu this leads to not-rejecting the hypothesis. This type of hypothesis is called left one-sided hypothesis. Problem of the hypothesis testing is either for a given significance level find cu or for a given sample statistic find the observed significance level (p-value).

Significance level It is common in hypothesis testing to set probability of Type I error,  to some values called the significance levels. These levels usually set to 0.1, 0.05 and 0.01. If null hypothesis is true and probability of observing value of the current test statistic is lower than the significance levels then hypothesis is rejected. Consider an example. Let us say we have a sample from the population with normal distribution N(,2). We want to test following null-hypothesis against alternative hypothesis: H0:  = 0 and H1:  < 0 This hypothesis is left one-sided hypothesis. Because all parameters of the distribution (mean and variance of the normal distribution) have been specified it is a simple hypothesis. Natural test statistic for this case is the sample mean. We know that sample mean has normal distribution. Under null-hypothesis mean for this distribution is 0 and standard deviation is /n. Then we can write: If we use the fact that Z is standard normal distribution (mean 0 and variance 1) then using the tables of standard normal distribution we can solve this equation.

Significance level: Cont. Let us define: Then we need to solve the equation (using standard tables or programs): Having found z we can solve the equation w.r.t cu. If the sample mean is less than this value of cu we would reject with significance level . If sample mean is greater than this value then we would not reject null-hypothesis. If we reject (sample mean is smaller than cu) then we would say that if the population mean would be equal to 0 then probability that we would observe sample mean is . To find the power of the test we need to find probability under condition that alternative hypothesis is true.

Significance level: An example. Let us assume that we have a sample of size 25 and sample mean is 128. We know that this sample comes from the population with normal distribution with standard deviation 5.4. We do not know population mean. We want to test the following hypothesis: H0: =130, against H1: <130 We have 0 = 130. Let us set significance level to 0.05. Then from the table we can find that z0.05=1.645 and we can find cu. cu= 0 –z0.05 5.4/25 = 130-1.645 *5.4/5 = 128.22 Since the value of the sample mean (128) belongs to the critical region (I.e. it is less than 128.22) we would reject null-hypothesis with significance level 0.05. Test we performed was left one-sided test. I.e. we wanted to know if the value of the sample mean is less than assumed value (130). Similarly we can build right one-sided tests and combine these two tests and build two sided tests. Right sided tests would look like H0: =0 against H1: >0 Then critical region would consist of interval [cl;). Where cl is the lower bound of the critical region And two sided test would look like H0: =0 against H1: 0 Then critical region would consists combination of two intervals (-;cu] [cl;).

Power of a test Power of a test depends on alternative hypothesis. Power of tests is the probability of critical region under alternative hypothesis. Let us consider the example above. Let us assume that the null hypothesis is that the mean value is 129. Since the mean value of the sample is outside the critical region we do not reject this hypothesis. (129-z0.05*5.4/5 = 127.2 < 128). Let us take an alternative hypothesis: mean is equal 126. We want to know what is the probability of accepting null hypothesis if alternative would be true. Take 0.05 confidence level. Then cu=127.2. We want to find probability of x<cu if alternative hypothesis is true. We want to find: P(x<cu | =126) = 0.86. The power of hypothesis is 0.86. I.e. if the mean value would be 126, by accepting null hypothesis that the mean value is equal to 129 we would make 86% of cases mistakes. Note that if the distribution of the population (therefore each sample point and sample statistics) is known then the power of the test with a given difference could be calculated even before sample is available. Power of the test depends on alternative hypothesis that is the difference between alternative and null hypothesis (1-0, where 0 is mean under null and 1 is under alternative hypothesis), the sample size and standard deviations.

Critical regions and power The table shows schematically relation between relevant probabilities under null and alternative hypothesis. do not reject reject Null hypothesis is true 1-  (Type I error) Null hypothesis is false  (Type II error) 1- 

Composite hypothesis In the above example we assumed that the population variance is known. It was simple hypothesis (all parameters of the normal distribution have been specified). But in real life it is unusual to know the population variance. If population variance is not known the hypothesis becomes composite (hypothesis defines the population mean but population variance is not known). In this case variance is calculated from the sample and it replaces the population variance. Then instead of normal t distribution with n-1 degrees of freedom is used. Value of z is found from the table of the tn-1 distribution. If n (>100) is large then as it can be expected normal distribution very well approximates t distribution. Above example can be easily extended for testing differences between means of two samples. If we have two samples from the population with equal but unknown variances then tests of differences between two means comes to t distribution with (n1+n2-2) degrees of freedom. Where n1 is the size of the first sample and n2 is the size of the second sample. If variances for both population would be known then test statistics for differences between two means has a normal distribution.

P-value of the test Sometimes instead of setting pre-defined significance level, p-value is reported. It is also called observed significance level. Let us analyse it. Let us consider above example when we had a sample of size 25 with the sample mean 128. We assumed that we knew population variance – 5.4. P-value is calculated as follows: We would reject null-hypothesis with significance level 0.05 but we would not reject it with significance level 0.01. If the population mean would be 130 observing 128 or less has the probability equal to 0.0322. In other words if would draw 100 times sample of size 25 then around three times we would observe that mean value is less or equal to 128.

Hypothesis testing vs intervals Some modern authors in statistics think that significance testing is overworked procedure. It does not make much sense once we have observed the sample. Then it is much better to work with confidence intervals. Since we can calculate statistics related with the parameter we want to estimate then we can make inference that where “true” value of the parameter may lie. As we could see in the above example we would reject particular hypothesis with significance level 0.01 but would accept with the significance level 0.05. Testing hypothesis did not say anything about parameter in spite of the fact that we had the sample mean. On the contrary confidence interval at least says where “true” value may be and do we need more experiment to increase our confidence and reduce interval size.

R commands for tests t.test - one, two-sample and paired t-test var.test - test for equality of variances power.t.test - to calculate power of t-test Some other tests. These are nonparametric tests wilcox.test - test for differences between means (works for one, two sample and paired cases) SignRank - for signed rank ks.test - Kolmogorov-Smirnov test for equality of distributions

Further reading Full exposition of hypothesis testing and other statistical tests can be found in: Stuart, A., Ord, JK, and Arnold, S. (1991) Kendall’s advanced Theory of statistics. Volume 2A. Classical Inference and the Linear models. Arnold publisher, London, Sydney, Auckland Box, GEP, Hunter, WG, Hunter, JS (1978) Statistics for experimenters