2 proportion z test

Introduction to Proportional Hypothesis Testing

  • When comparing two proportions, choose p1 (the proportion of one group) to be larger than p2 (the proportion of another group).

  • This simplifies calculations, as p1 - p2 will be a positive value.

  • Set the null hypothesis as H0: p1 - p2 = 0, indicating no difference between the two proportions.

Null Hypothesis and Assumptions

  • Null hypothesis (H0) states that p1 = p2, implying both proportions derive from the same population.

  • Verify the assumption that n1 and n2 are large enough (greater than 10).

  • Combine the sample sizes for the pooled proportion: p-hat pooled = (x1 + x2) / (n1 + n2).

Pooled Proportion Calculation

  • Pooled proportion should account for individual sample sizes:

    • p-hat pooled = (x1 + x2) / (n1 + n2).

    • Use this to ensure adequate sample representation when comparing proportions.

  • Check conditions:

    • n1 * p-hat pooled >= 10

    • n1 * q-hat pooled >= 10

    • n2 * p-hat pooled >= 10

    • n2 * q-hat pooled >= 10

Statistical Test

  • For hypothesis testing, conduct a two-sample Z test for proportions:

    • Test statistic formula: Z = (p-hat1 - p-hat2 - 0) / std_dev(p-hat1 - p-hat2).

    • Determine the Z score which indicates how many standard deviations away the sample proportion difference lies from the null hypothesis value.

Active vs Passive Solar Heating Systems

  • Differentiate between two groups in the solar heating context:

    • Passive Solar Heating Systems: The house itself is designed to collect solar energy (e.g., adobe houses).

    • Active Solar Heating Systems: Use mechanical devices, like solar panels, to convert sunlight into energy efficiently.

  • Evaluate the proportion of homes in each group that require less than 200 gallons of oil for fuel in a year.

Identifying Hypothesis and Data

  • Determine if it’s a proportion problem (not a means problem) and decide on a two-sample hypothesis test:

    • H0: p1 (active) - p2 (passive) not equal to.

  • Sample sizes from passive (n1) and active (n2) groups must be confirmed to be random and meet the size conditions.

Test Procedure

  • Example data:

    • For passive systems: 46 out of 52 homes require less than 200 gallons of oil.

    • For active systems: 37 out of 54 homes require less than 200 gallons of oil.

  • Compute pooled proportion:

    • p-hat pooled = (46 + 37) / (52 + 54) = 78.3%.

  • Validate n1 * p-hat pooled and n2 * p-hat pooled for both samples.

Conclusion and Decision Making

  • Calculate the Z score based on proportions and use it to derive the p-value.

  • Compare p-value with the chosen alpha (e.g., 1%, 5%):

    • If p-value > alpha, fail to reject the null hypothesis (H0).

    • Interpret results: If H0 is not rejected, the proportions are statistically similar, suggesting no significant difference in fuel consumption.

Summary of Findings

  • Reflect on the experimental outcomes:

    • If the observed proportion difference (~19.9%) is likely due to sampling variation (1.28% of the time), the active and passive systems do not differ significantly in oil consumption.

  • Acknowledge the larger context of how proportions in energy-efficient homes can inform building practices and energy conservation efforts.