Comparing Two Groups: Bivariate Analysis and Hypothesis Testing - Prof. Rickie Domangue, Study notes of Statistics

The comparison of two groups using bivariate analysis and hypothesis testing. It covers the concepts of response variable and explanatory variable, independent and dependent samples, assumptions, hypotheses, test statistics, and confidence intervals for the difference between two population proportions and means. The document also includes examples and calculations.

Typology: Study notes

Pre 2010

Uploaded on 02/13/2009

koofers-user-iva
koofers-user-iva 🇺🇸

10 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 9
Comparing Two Groups
9.0 Introduction
A. Bivariate Analyses: A Response Variable and a
Binary Explanatory Variable
Example - Response Variable Categorical
Response Variable = Student Binge drinker or
not
Explanatory Variable = Gender
Example - Response Variable Quantitative
Response Variable = GPA
Explanatory Variable - Gender
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Comparing Two Groups: Bivariate Analysis and Hypothesis Testing - Prof. Rickie Domangue and more Study notes Statistics in PDF only on Docsity!

Chapter 9

Comparing Two Groups

9.0 Introduction

A. Bivariate Analyses: A Response Variable and a Binary Explanatory Variable

  • Example - Response Variable Categorical
    • Response Variable = Student Binge drinker or not
    • Explanatory Variable = Gender
  • Example - Response Variable Quantitative
    • Response Variable = GPA
    • Explanatory Variable - Gender

1

B. Dependent and Independent Samples

  • Independent Samples
    • Experiment - subjects randomly assigned to two treatments, A and B. A and B are values of binary explanatory variable. Example: 100 patients with disease randomly assigned to new treatment (A), standard treat- ment (B), with 50 assigned to each. Binary Explanatory variable is treatment received. Re- sponse variable is length of life after treat- ment.
    • Observational study: one sample chosen at random from one population A and another sample chosen independently and at random from a second population B. A and B are val- ues of binary explanatory variable. Example: From one list of males(A), select random sample; from one list of females(B), select random sample. Binary response vari- able is gender. Response variable = GPA.
    • Observation study: subjects selected at ran- dom from one population, and then grouped by binary variable (A or B). Example: From one list of students, select a sample and then split sample into two accord- ing to live on campus (A) and live off campus (B). Binary explanatory variable is live on or off campus. Response variable = study time.

able is person in pair (husband or wife). Re- sponse variable is opinion on some issue.

9.1 Categorical Response: How Can We Com- pare Two Proportions

9.1.1 Significance Testing About Two Proportions

  1. Example 1 (Source: Devore and Peck. Some people seem to believe that you can fix anything with duct tape. Even so, many were skeptical when researchers announced that duct tape may be a more effective and less painful alternative to liquid nitrogen, which doctors routinely use to freeze warts. The article “What a Fix-It: Duct Tape Can Remove Warts” (San Luis Obispo Tribune, October 15, 2002) de- scribed a study conducted at Madigan Army Medical Center. Patients with warts were randomly assigned to either the duct tape group treatment or the more traditional freezing treatment. Those in the duct tape group wore duct tape over the wart for 6 days, then removed the tape, soaked the area in water, and used an emery board to scrape the area. This process was repeated for a maximum of 2 months or until the wart was gone. Of 100 people in the liquid nitrogen freezing group, 60 had their warts success- fully removed. Of 104 in the duct tape group, 88 had their warts successfully removed. Do the data suggest that freezing is less sucessful than duct tape in removing warts? Use a significance level α = 0.05.
  • Assumptions
    • Categorical response variable for two groups (here groups defined by binary explanatory variable: duct tape and liquid nitrogen groups; categorical response variable is wart removed (SUCCESS) or not removed (FAILURE))
    • Independent random samples in survey or ran- dom assignment in experiment (this example: 204 subjects randomly assigned to two treat- ments)
    • Two sample sizes n 1 and n 2 are sufficiently “large” to ensure that sampling distribution of ˆp 1 − pˆ 2 is approximately normal Rule of Thumb: Number of successes and num- ber of failures in both samples at least 10. Here, for liquid nitrogen group, 60 successes and 40 failures both at least 10, and for duct tape group, 88 successes and 16 failures, both at least 10.
  • Hypotheses
    • Let p 1 = population proportion of warts suc- cessfully removed by freezing and p 2 = popu- lation proportion of warts successfully removed with duct tape treatment.
    • Ho : p 1 = p 2 (that is p 1 − p 2 = 0)
    • Ha : p 1 < p 2 (that is p 1 − p 2 < 0)
  • Test Statistic
    • Let ˆp 1 be the random variable, sample propor- tion of 100 subjects assigned to liquid nitrogen treatment whose warts are removed

is rejected and the alternative hyp. is accepted. Answer question: Yes, the data do suggest that freezing is less successful than duct tape in re- moving warts.

  1. Example 2 A consumer magazine polls car owners to see if they are happy enough with their vehicles that they would purchase the same model again. They randomly selected 450 owners of American- made cars and 450 owners of Japanese models. 342 of the 450 owners of American-made cars said they would purchase the same model again. 351 of the 450 owners of the Japanese model said they would pur- chase the same model again. Is there sufficient evi- dence of a difference in opinion among the two types of car owners? Use a significance level α = 0.05. - Assumptions - Categorical response variable for two groups (here groups defined by binary explanatory variable: own American-made car, own Japanese- made car; categorical response variable is would purchase same model again (SUCCESS) or not purchase same model again (FAILURE)) - Independent random samples in survey or ran- dom assignment in experiment (this example: two samples of car owners were randomly and independently selected) - Two sample sizes n 1 and n 2 are sufficiently “large” to ensure that sampling distribution of ˆp 1 − pˆ 2 is approximately normal

Rule of Thumb: Number of successes and num- ber of failures in both samples at least 10. Here, for American-made car owners, group, 342 successes and 108 failures both at least 10, and Japanese-made car owners, 351 successes and 99 failures, both at least 10.

  • Hypotheses
    • Let p 1 = population proportion of all owners of American-made cars that would purchase same model again and p 2 = population pro- portion of all owners of Japanese-made cars that would purchase same model again.
    • Ho : p 1 = p 2 (that is p 1 − p 2 = 0)
    • Ha : p 1 6 = p 2 (that is p 1 − p 2 6 = 0)
  • Test Statistic
    • Let ˆp 1 be the random variable, sample pro- portion of random sample of 450 owners of American-made cars that would purchase again
    • Let ˆp 2 be the random variable, sample pro- portion of random sample of 450 owners of Japanese-made cars that would purchase again
    • Test Statistic z = √p ˆ(1(ˆp−^1 −pˆ)(pˆ^2 ) 1 −^0 n 1 +^ n^12 ) p ˆ = proportion of owners that would purchase again pooled across both groups
  • P value
    • Suppose that H 0 is true. The z test statistic has an approximate stan- dard normal distribution when Ho is true

9.1.2 Confidence Interval for the difference between two population proportions A. Large Sample Confidence Interval: (ˆp 1 − pˆ 2 ) ± (z)

√ pˆ 1 (1−pˆ 1 ) n 1 +^

pˆ 2 (1−pˆ 2 ) n 2 z score depends on confidence level, such as 1.96 for 95% confidence B. Assumptions:

  1. Independent random samples/random assignment for two groups
  2. Large enough sample sizes n 1 and n 2 so that there are at least 10 successes and 10 failures in each group. C. Example (DeVeaux, Velleman, Bock). There has been debate among doctors over whether surgery can prolong life among men suffering from prostate cancer, a type of cancer that typically develops and spreads very slowly. In the summer of 2003, The New England Journal of Medicine published results of some Scandinavian research. Men diagnosed with prostate cancer were randomly assigned to either un- dergo surgery or not. Among the 347 men who had surgery, 16 eventually died of prostate cancer, com- pared with 31 of the 348 men who did not have surgery. Construct a 95% confidence interval for the difference in rates of death for the two groups of men. Binary Explanatory variable = surgery or not Response variable = died from prostate cancer (suc- cess) or not (failure) No surgery group: ˆp 1 = 31/348 = 0. 089

Surgery group: ˆp 2 = 16/347 = 0. 046

z score for 95% confidence is 1.

(0. 089 − 0 .046) ± (1.96)

√ (0.089)(1− 0 .089) 348 +^

(0.046)(1− 0 .046) 347

  1. 043 ± 0. 037

  2. 006 < p 1 − p 2 < 0. 080

Interpretation: We are 95% that among persons diagnosed with prostate cancer, the rate of death from prostate cancer is somewhere between 0.6% and 8% higher for those not having surgery as compared to those having surgery.

Assumptions: 1. Subjects randomly assigned to two treatment groups 2. Samples sizes are large: 31/317 successes/failures (at least 10) in surgery group; and 16/331 successes/failures (at least 10) in non surgery group;

  • Assumptions
    • Independent random samples in obs. study or random assignment in experiment. In this ex- ample, assume two groups of women represent independent random samples.
    • Two sample sizes n 1 and n 2 are both large (in general, 30 or larger), or population distribu- tions are normal. In this example, the two sample sizes are small, so the population dis- tributions of BDM for the two groups have to be normally distributed.
  • Hypotheses
    • Let μ 1 = population mean BMD for women who used oral contraceptives and μ 2 = popu- lation mean BMD for women who never used oral contraceptives
    • Ho : μ 1 = μ 2 (that is μ 1 − μ 2 = 0)
    • Ha : μ 1 < μ 2 (that is μ 1 − μ 2 < 0)
  • Test Statistic
    • Let x 1 be the random variable, sample mean BMD of 10 women randomly selected from population of women using oral contraceptives
    • Let x 2 be the random variable, sample mean BMD of 10 women randomly selected from population of women who have never used
    • Test Statistic t = (x√^1 −^ s 2 x^2 )−^0 n^11 +^ s n^211
  • P value
    • Suppose that H 0 is true. The t test statistic has a (approximate) t dis- tribution with df = smaller of n 1 −1 and n 2 −1.
    • Calculated x 1 = 1. 00 Calculated x 2 = 1. 08 Calculated s 1 = 0. 14 Calculated s 2 = 0. 16 Calcuated t = (1√.^00 0. 14 − 21 .08)−^0 10 +^0.^16 2 10 Calculated t = − 0.^0071.^08 = − 1. 13 df = smaller of 10-1, 10-1 = 9 P-value = P [t ≤ − 1 .13] ≈ 0. 15
  • Conclusion (Interpretation of P-value, conclusion about hypotheses, answer questions posed). Interpretation: There is about a 15% chance of obtaining a dif- ference in sample means like -0.08 (or more ex- treme) from sampling error if in fact the popula- tion means of BMD are the same (null true). Conclusion about hypotheses: The P-value, about 15%, is greater than our sig- nificance level of 0.05, so the null hypothesis is not rejected. Answer question: No, the data do not provide sufficient evidence that women who use oral con- traceptives have a lower mean BMD than women who have never used oral contraceptives.

Hg) are consistent with summary quantities appear- ing in the paper:

Talking 104, 110, 107, 112, 108, 103, 108, 118

n 1 = 8, x 1 = 108.75,s 1 = 4. 74

Counting 110,96,103,98,100,109,97,

n 2 = 8, x 2 = 102.25,s 2 = 5. 39

df = smaller of n 1 − 1,n 2 − 1 = 7

t score for 95% confidence is 2.

(108. 75 − 102 .25) ± (2.365)

√ (4.74)^2 8 +^

(5.39)^2 8

  1. 5 ± (2.365)(2.54)

  2. 5 ± 6. 01

(0. 49 , 12 .5)

  1. 49 < μ 1 − μ 2 < 12. 5

Interpretation: We are 95% confident that the mean diastolic blood pressure when talking is higher than the mean when counting by somewhere between 0.49 and 12.5 mm Hg.

Assumptions: 1. Subjects randomly assigned to two treatment groups 2. Blood pressure is normally distributed for each group