430 likes | 445 Views
Conducting and Interpreting Appropriate Hypotheses Tests Prof Catherine Comiskey. Overview. Steps to follow in all Hypotheses Tests Hypotheses Tests for Continuous Data z tests and t tests One sample test of mean or of a proportion
E N D
Conducting and Interpreting Appropriate Hypotheses TestsProf Catherine Comiskey School of Nursing and Midwifery 24 D'Olier Street Dublin 2
Overview • Steps to follow in all Hypotheses Tests • Hypotheses Tests for Continuous Data • z tests and t tests • One sample test of mean or of a proportion • Comparing two means or two proportions in two sample t-tests (independent samples or matched pairs?) School of Nursing and Midwifery 24 D'Olier Street Dublin 2
Overview continued • Hypotheses Tests for Categorical Data • One, two and three way tables, • Chi squared for one and two way tables • Sparse cells and Fishers exact test • Longitudinal data and the McNemar Test • Three way tables and CMH conditional tests • Understanding and Interpreting the results School of Nursing and Midwifery 24 D'Olier Street Dublin 2
Course • References • SPSS Survival Manual, Julie Pallant, Open University Press • Contemporary Business Statistics, Williams, Sweeney and Anderson, Thompson Publishers. School of Nursing and Midwifery 24 D'Olier Street Dublin 2
Hypothesis Testing • Developing Null and Alternative Hypotheses • Type I and Type II Errors • Population Mean: s Known • Population Mean: s Unknown • Population Proportion
Developing Null and Alternative Hypotheses • Hypothesis testing can be used to determine whether • a statement about the value of a population parameter • should or should not be rejected. • The null hypothesis, denoted by H0 , is a tentative • assumption about a population parameter. • The alternative hypothesis, denoted by Ha, is the • opposite of what is stated in the null hypothesis. • The alternative hypothesis is what the test is attempting to establish.
Developing Null and Alternative Hypotheses • Testing Research Hypotheses • The research hypothesis should be expressed as • the alternative hypothesis. • The conclusion that the research hypothesis is true • comes from sample data that contradict the null • hypothesis.
Developing Null and Alternative Hypotheses • Testing the Validity of a Claim • Manufacturers’ claims are usually given the benefit • of the doubt and stated as the null hypothesis. • The conclusion that the claim is false comes from • sample data that contradict the null hypothesis.
Developing Null and Alternative Hypotheses • Testing in Decision-Making Situations • A decision maker might have to choose between • two courses of action, one associated with the null • hypothesis and another associated with the • alternative hypothesis. • Example: Accepting a shipment of goods from a • supplier or returning the shipment of goods to the • supplier
Summary of Forms for Null and Alternative Hypotheses about a Population Mean • The equality part of the hypotheses always appears in the null hypothesis. • In general, a hypothesis test about the value of a • population mean must take one of the following • three forms (where 0 is the hypothesized value of • the population mean). One-tailed (lower-tail) One-tailed (upper-tail) Two-tailed
Null and Alternative Hypotheses • Example: City EMS A major capital city provides one of the most comprehensive emergency medical services in the world. Operating in a multiple hospital system with approximately 20 mobile medical units, the service goal is to respond to medical emergencies with a mean time of 12 minutes or less.
Null and Alternative Hypotheses • Example: City EMS The director of medical services wants to formulate a hypothesis test that could use a sample of emergency response times to determine whether or not the service goal of 12 minutes or less is being achieved.
Null and Alternative Hypotheses The emergency service is meeting the response goal; no follow-up action is necessary. H0: The emergency service is not meeting the response goal; appropriate follow-up action is necessary. Ha: where: = mean response time for the population of medical emergency requests
Type I Error • Because hypothesis tests are based on sample data, • we must allow for the possibility of errors. • A Type I error is rejecting H0 when it is true. • The probability of making a Type I error when the null hypothesis is true as an equality is called the level of significance. • Applications of hypothesis testing that only control the Type I error are often called significance tests.
Type II Error • A Type II error is accepting H0 when it is false. • It is difficult to control for the probability of making a Type II error. • Statisticians avoid the risk of making a Type II error by using “do not reject H0” and not “accept H0”.
Type I and Type II Errors Population Condition H0 True (m< 12) H0 False (m > 12) Conclusion AcceptH0 (Concludem< 12) Correct Decision Type II Error Type I Error Correct Decision RejectH0 (Conclude m > 12)
p-Value Approach to One-Tailed Hypothesis Testing • The p-value is the probability, computed using the test statistic, that measures the support (or lack of support) provided by the sample for the null hypothesis. • If the p-value is less than or equal to the level of significance , the value of the test statistic is in the rejection region. • Reject H0 if the p-value <.
Sampling distribution of Lower-Tailed Test About a Population Mean: s Known p-Value <a, so reject H0. • p-Value Approach a = .10 p-value 72 z z = -1.46 -za = -1.28 0
Sampling distribution of Upper-Tailed Test About a Population Mean: s Known p-Value <a, so reject H0. • p-Value Approach a = .04 p-Value 11 z za = 1.75 z = 2.29 0
Steps of Hypothesis Testing Step 1. Develop the null and alternative hypotheses. Step 2. Specify the level of significance . Step 3. Collect the sample data and compute the test statistic. p-Value Approach Step 4. Use the value of the test statistic to compute the p-value. Step 5. Reject H0 if p-value <a.
One-Tailed Tests About a Population Mean: s Known • Example: City EMS The response times for a random sample of 40 medical emergencies were tabulated. The sample mean is 13.25 minutes. The population standard deviation is believed to be 3.2 minutes. The EMS director wants to perform a hypothesis test, with a .05 level of significance, to determine whether the service goal of 12 minutes or less is being achieved.
One-Tailed Tests About a Population Mean: s Known • p -Value and Critical Value Approaches 1. Develop the hypotheses. H0: Ha: a = .05 2. Specify the level of significance. 3. Compute the value of the test statistic.
One-Tailed Tests About a Population Mean: s Known • p –Value Approach 4. Compute the p –value. For z = 2.47, cumulative probability = .9932. p–value = 1 - .9932 = .0068 5. Determine whether to reject H0. Because p–value = .0068 <a = .05, we reject H0. There is sufficient statistical evidence to infer that City EMS is not meeting the response goal of 12 minutes.
Sampling distribution of One-Tailed Tests About a Population Mean: s Known • p –Value Approach a = .05 p-value z za = 1.645 z = 2.47 0
p-Value Approach to Two-Tailed Hypothesis Testing • Compute the p-value using the following three steps: 1. Compute the value of the test statistic z. 2. If z is in the upper tail (z > 0), find the area under the standard normal curve to the right of z. If z is in the lower tail (z < 0), find the area under the standard normal curve to the left of z. 3. Double the tail area obtained in step 2 to obtain the p –value. • The rejection rule: Reject H0 if the p-value <.
Tests About a Population Mean:s Unknown • Test Statistic This test statistic has a t distribution with n - 1 degrees of freedom.
Tests About a Population Mean:s Unknown • Rejection Rule: p -Value Approach Reject H0 if p –value <a
p -Values and the t Distribution • The format of the t distribution table provided in most • statistics textbooks does not have sufficient detail • to determine the exact p-value for a hypothesis test. • An advantage of computer software packages is that the computer output will provide the p-value for the t distribution.
A Summary of Forms for Null and Alternative Hypotheses About a Population Proportion • The equality part of the hypotheses always appears in the null hypothesis. • In general, a hypothesis test about the value of a population proportion pmust take one of the following three forms (where p0 is the hypothesized value of the population proportion). One-tailed (lower tail) One-tailed (upper tail) Two-tailed
Tests About a Population Proportion • Test Statistic where: assuming np> 5 and n(1 – p) > 5
Tests About a Population Proportion • Rejection Rule: p –Value Approach Reject H0 if p –value <a
Categorical Data and Chi Squared Tests • Surveys and studies often involve making observations on one or more categorical variables. • Sample data is then summarised in • A one way frequency table. • A two way frequency table. • A contingency table.
Example • A Professor of paediatrics observed 287 mothers 4 days after they had given birth and noticed on which side they held their baby. • The results were as follows
Example contd. • Does this evidence suggest at the 0.01 level of significance that a mother is equally likely to hold her baby on either side? • Let PL=P(left side) Pr=P(right side)
Association in a Contingency Table • Example: When 287 mothers were classified as left handed or right handed the results were as follows
Example Contd. • Does the evidence suggest at the 0.01 level of significance that the side on which a mother holds her baby is independent of handedness? • Note: we use a Chi squared test that compares observed frequencies in the 2x2 table with the frequencies we would expect were the variables to be independent.
Example contd. Table of expected frequencies.
Example Contd. • The chi-squared statistic is a scaled measure of the discrepancy between the observed frequencies and the expected frequencies. • Which will have approximately the chi-squared distribution with number of degrees of freedom df=v=(r-1)(c-1) for an r x c contingency table • For 2x2 table df=(2-1)(2-1)=1
Example contd. • Here Chi squared = 0.50 (worked out using spss or by hand using formula given) • Df = v= (r-1)(c-1)=(2-1)(2-1)=1 • Alpha = 0.01 • p> 0.01 (from computer package spss) • We do not reject H0 at the 1% level of significance • We conclude that the side a mother holds her baby is independent (not associated with) handedness.
Notes • In general in an r x c contingency table: • We have two categorical variables, the hypothesis are then of the form H0: variables independent i.e. no relationship HA: variables dependent • Expected freq=(row total)(col. total)/sample size
Notes contd. • The chi-squared test is applicable only to large samples. • Generally valid provided no more than one cell has an expected frequency less than five ***.
EXAMPLES ROSIE Findings 1 http://www.nacd.ie/publications/treatment_rosie.html