1 / 51

Lecture8 Test forcomparison of proportion

Lecture8 Test forcomparison of proportion. Xiaojinyu@seu.edu.cn. review. Basic logic for Hypothesis t test for comparison of means t test for one sample design t test for Paired design Completely randomized design. Example7.1.

tino
Télécharger la présentation

Lecture8 Test forcomparison of proportion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture8 Test forcomparison of proportion Xiaojinyu@seu.edu.cn

  2. review • Basic logic for Hypothesis • t test for comparison of means • t test for one sample design • t test for Paired design • Completely randomized design

  3. Example7.1 Sample:25 female patients were randomly selected, and their Hb of blood were tested. The mean of Hb is 150g/L,and the sd 16.5g/L. Question: Do these data provide sufficient evidence to indicate that the mean of Hb of all of female patients who suffer from the same disease is different from the mean of Hb of normal female (The mean of Hb of normal female is 132g/L)。

  4. Solution to Example • Hypothesis: H0 : 1= 132, Hb of female patients is equal to normal female ; H1 : 1  132 , Hb of female patients is different from that of normal female; =0.05 2.Test statistic: υ=25-1=24 3. t0.025,24=2.064, t>t0.025,24, so P < 0.05, Reject H0 at the level of =0.05, the difference is statistically significant.Conclusion: The mean of Hb of patients is different from the normal female.

  5. t test for Paired or matched dataExample: Two equipments to test noise(db) at same site and time

  6. Solution To Example (1) H0 : d=0, the results from 2 equipments are same. H1 : d≠0, the results from 2 equipments are different. =0.05 (2)Calculate t =9 (t 0.025,9 = 2.262) (3) P>0.05(0.2<P<0.4),so we have no evidence to reject H0 at level 0.05 test results of two equipments are not different.

  7. EX7.4 (comparison of LPO between two groups ) • Obesity group:n1=30, • Normal group :n2=30, • Difference in nature? • Sampling error? • INFERENCES ON TWO POPULATIONS USING DATA FROM INDEPENDENT SAMPLES

  8. Solution to example7.4 (1) H0 : 1=2, LPO of obesity people is same to normal people; H1 : 1≠2 , LPO of obesity people is same to normal people; =0.05。 (2) t and  (= n1+n2 -2)。

  9. Solution to example7.4 Cont. (2) (t 0.025,58 = 2.002) (3) t>t 0.025,58 = 2.002, so P<0.05(P <0.0001), Reject H0 at 0.05 level, The LPO of obesity group is different from the LPO of normal men. 

  10. Are the 2 population proportions equal or not? How categorical variables are distributed among 2 population? Example8.1: Results from a cancer Clinical Trial for drug

  11. Are the 2 population proportions equal or not? How categorical variables are distributed among 2 population? Example8.1: Results from a cancer Clinical Trial for drug

  12. Objective • To infer if proportion H0: π1=π2 by comparison 2 sample proportion p1, p2

  13. Z-test for Binomial Distribution Data • The method of normal approximation • An alternative solution of chi-Squared Test • Assumption about n and p

  14. Four-fold Table Actual frequency

  15. Outline of χ2 -Test • Basic logic • Completely Random Design • One sample design • Paired Design

  16. Statistician for chi-Squared Test • British • Karl Pearson 1857~1936 • 1901.10 created Biometrika together with Weldon and Galton

  17. The First Thought of Significance Test • The earliest clearly thought-out use of hypothesis testing probably belong to Karl Pearson. • From Encyclopedia of Biostatistics. Peter Armitage,Theodore Colton

  18. Basic Logic of Test • Is a die fair or not? • Throw a die to test

  19. Basic logic of it

  20. Basic logic • An investigation of the degree of agreement of Theoretical (expected) frequency & Actual (observed) frequency

  21. χ2-Distribution

  22. Basic logic of χ2 test

  23. Are the 2 population proportions equal or not? How categorical variables are distributed among 2 population? Example8.1: Results from a cancer Clinical Trial for drug

  24. χ2 -Test for Completely Random Design • 2X2 contingency table-comparison between 2-sample proportion or percentage • rXc contingency table-comparison between more than 2-sample proportions or percentages

  25. Steps of Chi-square test • Hypothesis and significance level • Test statistic & degree of freedom • Compare to Critical value or to get exact P value • Statistical decision and conclusion

  26. Test Hypothesis & Significance Level • H0: πA = πB • H1: πA≠πB,α=0.05 • 2 population probabilities are equal with respect to extent of effect of drugs. • There is no relationship between drug and effect; • Basically, the chi-square test of independence tests whether the columns are contingent on the rows in the table.

  27. If The H0 Is True, then • We take Pc, combined rate as estimation to population rate, that is theoretical Effective Rate

  28. Theoretical Effective Rate • If the H0 is true, We will expect to find n1*Pc effective patients in group A, • n1*(1-Pc) ineffective patients and so on.

  29. Theoretical frequency

  30. Test Statistic

  31. Calculation of Test Statistic

  32. Distribution of Test Statistic • If H0 is true, χ2is distributed χ2approximately as with(r-1)(c-1) degrees of freedom. • Df= (r-1)(c-1) =

  33. Χ2 critical values

  34. χ2 -Distribution • The chi-square distribution results when independent variables with standard normal distributions are squared and summed. • Positively skewed distribution • 2 values will never be negative; minimum is 0 • 2 of close to 0 indicates that the variables are independent of one another

  35. Decision Rule • We let the probability of committing a type Ⅰerror be 0.05.So If the computed χ2 value of is equal to or greater than 3.84, reject H0.that is to say, the critical value is 3.84.

  36. Statistical Decision and Conclusion • Since 6.5732>3.84, we reject H0. • We conclude that the two populations are not homogeneous with respected to effect of drug. The effects of drug A and drug B are not equivalent.

  37. Basis of Chi-square Test of Independence • Construct bivariate table as it would look if there were no relationship • Compare the real table to the hypothetical one • Measure how different they are • if there are large differences, we conclude that there is a significant relationship….if not we conclude that its just chance that our numbers vary

  38. Basic Assumption on Sample Size • The sample size must be sufficiently large to ensure the approximation is valid. • Each expected frequency T should be at least equal to 5. • N ≥ 40 & T≥5 • Because χ2distribution is continuous, the critical values are only approximately correct for determining the P-value.

  39. Correction for Continuity n ≥ 40, 1<=T<5

  40. Example of Correction • Table 8-2 Results from Trial of Treatments for Some Cancer Patients χ2=0.595

  41. Fisher Exact Test • When n<40 or one of T happens to be less than 1, the correction for continuity is not enough

  42. χ2- Test for A Paired Design • A Paired Design with 2 categories variables • A Paired Design with more than 2 categories variables

  43. A Paired Design • Table 8-3 Results from two culture Media to detect some bacteria • The two media, evaluated for the same sample of 56 • specimens, give counts of the positive and negative • results, as given in table.

  44. Mcnemar Test • Q. Mcnemar (1947). Note on the samplng error of the difference between correlated proportions or percentages, Psychometika 12, 153-4-157 • Psychology-two correlated dichotomous responses were to be compared.

  45. Objective of Test • are the Positive rates of two media the same? • H0:πA=πB, the positive rates for two culture media are the same • How do we calculate the positive rates?

  46. Positive rate of A Positive rate of B Marginal Proportion • What we need for test are the counts in these off-diagonal cells. • b and c

  47. Solution to example8.3 • The critical value χ2 0.05,1=3.84, 11.25>3.84, the P-value associated with a test statistic of 13.91 is less than 0.05. • We reject H0. the positive rates for two culture media are not the same.

  48. Requirements for χ2 -Test • Must be a random sample from population • Data must be in raw frequencies -Actualcount data • Variables must be independent arranged • Categories for each I.V. must be mutually exclusive and exhaustive • A sufficiently large sample size (at least 40)

  49. Important Limitation of X2 test • sensitive to sample size. • Doubling sample size doubles X2 if the distribution stays the same. • Remember the distinction between statistical significance and substantive significance

  50. At the end of this session you will be able to: • Prepare a contingency table • Realize which study designs are suitable for applying the chi square test and the basic procedure • Understand the assumptions / limitations of the chi square test.

More Related