Oe-sample test of proportios The Settig: Idividuals i some populatio ca be classified ito oe of two categories. You wat to make iferece about the proportio i each category, so you draw a sample. Examples: Drug X is admiistered to 100 patiets with a particular disease. 50 improve. Test whether this drug is better tha drug Y, which is kow to produce improvemet i 45% of patiets. I a poll of 500 voters, 200 say that they will support a particular cadidate i the electio. Give a 95% cofidece iterval for the proportio of all voters who will support the cadidate.
Oe-sample test of proportios Iferetial Procedures: Hypothesis Test - critical value method - p-value method - cofidece iterval method Cofidece Iterval
Oe-sample test of proportios Hypothesis Test: Specify the ull ad alterative Defie rejectio regio for the test statistic z HA: p p H0: p= p0 < 0 HA: p p0 0 HA: p> p z z z
Oe-sample test of proportios Test Statistic: z = p pˆ If H 0 is true, z comes from stadard ormal distributio Critical value method: Choose z* from ormal table to defie rejectio regio If z falls i rejectio regio, reject H 0 P-value method: Use the ormal table to determie probability of a value at least as extreme as z comig from stadard ormal distributio. Report this p-value ad your coclusio. p 0 (1 p ) 0 0
Oe-sample test of proportios Level-C Cofidece Iterval: ˆ (1 ˆ) p = pˆ ± z* p p To perform a two-sided test of H 0 : p = p 0 at sigificace level α, you ca calculate the level-(1- α) cofidece iterval ad check whether p 0 falls withi the iterval.
Two-sample tests: overview Types of two-sample tests: two-sample z-test two-sample t-test two-sample test of proportios
Two-sample z-test The Settig: You wat to determie whether two differet populatios have the same mea for some variable of iterest, so you draw two idepedet samples. Furthermore, you kow the variaces i these two populatios without error. I real life, this would oly ted to happe if your samples were so large (e.g., 5,000) that you could preted that the sample variaces were really the true variaces Example: SAT scores for studets who use a particular prep course have a SD of 100, while those for studets who do ot use the course have a SD of 150. You sample 50 studets who take the course ad 50 who do ot. Test whether takig the course chages the mea score for studets
Two-sample z-test Hypothesis Test H : μ μ A x < y H μ H μ 0: x y A: x μy = μ H : μ μ A x > y z z z Where the test statistic is z = X σ 2 x x Y σ + 2 y y
Two-sample t-test The Settig: You wat to determie whether two differet populatios have the same mea value for some variable of iterest. You draw two idepedet samples to test this. Note that i geeral we will use this test istead of the z- test, sice we will ot kow the populatio stadard deviatios without error. Example: You wat to determie whether studets who take a give prep course have, o average, the same SAT score as those who do ot. You sample 50 studets who take the course ad 50 who do ot ad record their SAT scores
Hypothesis Test Two-sample t-test Null ad alterative hypotheses same as for two-sample z-test Test statistic is ow t = X s 2 x x Y + s 2 y y If H 0 is true, t follows a t-distributio with df = mi( x 1, y 1)
Two-sample t-test Commo Mistake: Sometimes you will have what appear to be two idepedet samples, but are really two observatios each o a sigle set of uits. Use oe-sample methods for iferece o such data. This sample will cosist of the differeces betwee the two values for each subject.
Not a Two-sample t-test Example: You wat to determie whether a drug lowers patiet cholesterol. You record the cholesterol levels of 100 voluteers, the admiister the drug for three moths. After this period you agai measure the patiets cholesterol values Strategy: Defie D = chage i a patiet s cholesterol after takig drug. Now do a oe-sample t-test: H0: μ D = 0 HA: μ D< 0 The test statistic will the be t = D s 2 D D 0
Two-sample test of proportios The Settig: I two idepedet populatios, idividuals ca be classified ito oe of two categories. You draw samples from both populatios to make iferece about whether the category proportios are the same i both populatios Example: You take a sample of 100 govermet cocetrators ad 100 cocetrators from other fields. Test whether beig a govermet cocetrator makes a college studet more or less likely to vote.
Two-sample test of proportios Hypothesis test: H : p A x y H0: px = py < p HA : px py H : p p A x > y Where z z z The test statistic is pˆ = pˆ x x y y x + pˆ + y z = pˆ x pˆ 1 1 pˆ(1 pˆ) + y x y
Two-sample test of proportios Level-C Cofidece Iterval: pˆ (1 ˆ x px) ( p ) ( ˆ ˆ x py = px py) ± z* + x pˆ y (1 pˆ ) y y Commo Mistake: Notice that i this case the stadard errors of the hypothesis test ad cofidece iterval are differet!
Chi-square test The Settig: I two (or more) idepedet populatios, idividuals ca be classified ito two (or more) differet categories. You draw samples from all populatios to test whether the category a idividual falls ito is idepedet of that idividual s populatio. Example: You choose a sample of 100 me ad 100 wome ad ask subject whether s/he watches professioal football. Test whether geder is idepedet of football viewig
Chi-square test Hypothesis test (Cotiuig our example): H 0 : geder is idepedet of watchig football H A : geder is ot idepedet of watchig football Remember that we caot test a oe-sided alterative usig the chi-square test!
Chi-square test Procedure: 1. Create the 2x2 table of observed couts 2. Create the 2x2 table of expected couts 3. Calculate the χ 2 statistic 4. Draw coclusio
Chi-square test 1. Create the 2x2 table of observed couts 2. Create the 2x2 table of expected couts Expected cout i a cell = r c Where r = row total for that cell, c = colum total for that cell, = total for whole table
Chi-square test 3. Calculate the χ 2 statistic χ ( Observed Expected) 2 = Expected 2 Where the summatio is over all cells.
Chi-square test 4. Draw coclusio Uder H 0, χ 2 follows a chi-square distributio with (r-1)(c-1) degrees of freedom To use the critical value method, determie the value x* that cuts off α of the tail area. Reject H 0 if χ 2 > x*. To use the p-value method, determie the area to the right of χ 2 o the chi-square curve. Report this p-value ad draw your coclusio. Area = α Area = p-value x* χ 2