π Lecture 44 β Randomized Complete Block Design, The Least Significant Difference (LSD) Test, Chi-Square Test of Goodness of Fit
π Overview: This lecture completes the analysis of the Randomized Complete Block (RCB) Design with a detailed example, teaching how to partition total variation into treatment, block, and error components. It then introduces the Least Significant Difference (LSD) test for pairwise comparisons of treatment means after a significant ANOVA result. Finally, it covers the Chi-Square Test of Goodness of Fit, demonstrating how to mathematically determine whether observed frequencies follow a hypothesized theoretical distribution.
ποΈ Topics Covered
The lecture covers the complete analysis of variance for a Randomized Complete Block Design using a feeding experiment example with four rations and five groups of animals. It then explains the Least Significant Difference (LSD) test procedure for comparing all pairs of treatment means simultaneously. The final major topic is the Chi-Square Test of Goodness of Fit, including its hypothesis testing procedure, computation of expected frequencies from a fitted binomial distribution, and the requirement for merging categories with small expected frequencies.
π Lecture Summary
Randomized Complete Block Design
The lecture begins with a detailed example of an RCB design involving a feeding experiment where four types of rations (treatments) were given to animals in five groups (blocks) of four each. The data represents weight gains in pounds, and the analysis of variance aims to test two sets of hypotheses. The primary hypothesis tests whether all ration means are equal, while a secondary hypothesis tests whether all group (block) means are equal.
π Definition β Randomized Complete Block Design: An experimental design where subjects are first divided into homogeneous groups (blocks), and then all treatments are randomly assigned within each block.
Computations: The analysis requires calculating Total Sum of Squares, Treatment Sum of Squares, Block Sum of Squares, and Error Sum of Squares.
π Total SS = ΣΣXΒ²ij β (T..Β²/n) = 21725.22 β (656.4Β²/20) = 21725.22 β 21543.05 = 182.17
π Treatment SS = Ξ£(T.jΒ²/r) β (T..Β²/n) = 108387.48/5 β 21543.05 = 21677.50 β 21543.05 = 134.45
π Block SS = Ξ£(Bi.Β²/c) β (T..Β²/n) = 86258.04/4 β 21543.05 = 21564.51 β 21543.05 = 21.46
π Error SS = Total SS β (Treatment SS + Block SS) = 182.17 β (134.45 + 21.46) = 26.26
The degrees of freedom are: treatments (c-1=3), blocks (r-1=4), error [(r-1)(c-1)=12], and total (rc-1=19).
The ANOVA table shows F1 = 44.82/2.19 = 20.47 for treatments and F2 = 5.36/2.19 = 2.45 for blocks.
Conclusions: Since F1 = 20.47 exceeds the critical value F0.05(3,12) = 3.49, we reject H0 and conclude there is a difference among at least two treatment means. Since F2 = 2.45 does not exceed F0.05(4,12) = 3.26, we accept Hβ²0 and conclude that blocking was not actually required for this experiment.
π‘ Why this matters: If blocking is unnecessary, future experiments can use a Completely Randomized Design, which retains more degrees of freedom for Error, providing a better estimate of error variation.
The Least Significant Difference (LSD) Test
After finding significant differences among treatment means, the LSD test helps determine which specific treatments differ from each other. This procedure computes the smallest difference that would be judged significant and compares all pairwise differences of means with this value.
π Definition β Least Significant Difference (LSD): The smallest absolute difference between two sample means that would be considered statistically significant.
π Formula: LSD = tΞ±/2(Ξ½) Γ β[2(MSE)/r] β Where MSE is the Mean Square for Error, r is the equal sample size, and tΞ±/2(Ξ½) is the t-value at Ξ±/2 level with error degrees of freedom.
π Example: With MSE = 2.19, r = 5, and t0.025(12) = 2.179: LSD = 2.179 Γ β[2(2.19)/5] = 2.179 Γ β0.876 = 2.179 Γ 0.936 = 2.04
The four treatment means are: XΜD = 28.38, XΜC = 33.70, XΜA = 34.42, XΜB = 34.78.
Arranging in ascending order and comparing differences against LSD = 2.04:
- |XΜC β XΜD| = |33.70 β 28.38| = 5.32 > 2.04 β Significant
- |XΜA β XΜC| = |34.42 β 33.70| = 0.72 < 2.04 β Not significant
- |XΜB β XΜA| = |34.78 β 34.42| = 0.36 < 2.04 β Not significant
The conclusion is that rations C, A, and B are not significantly different from each other, but ration D is significantly different and performs poorest.
Chi-Square Test of Goodness of Fit
This test determines mathematically whether observed frequencies from a sample match expected frequencies based on a theoretical distribution. The lecture demonstrates this using the binomial distribution example from Lecture No. 28, where a loaded die was tossed 5 times and the number of sixes was recorded.
Properties of Chi-Square Distribution:
- Continuous distribution ranging from 0 to +β
- Positively skewed, with skewness decreasing as degrees of freedom increase
- Tends to normal distribution as degrees of freedom approach infinity
Hypothesis Testing Procedure for Goodness of Fit:
Step 1: H0: The fit is good vs HA: The fit is not good Step 2: Ξ± = 0.05 Step 3: Test-statistic: ΟΒ² = Ξ£[(oi β ei)Β²/ei] Step 4: Computations with observed and expected frequencies
π Example: From the binomial data with n=5 and p=0.398 (calculated from sample mean xΜ=1.99):
| x | oi | ei | (oiβei)Β²/ei |
|---|---|---|---|
| 0 | 12 | 15.8 | 0.91 |
| 1 | 56 | 52.5 | 0.23 |
| 2 | 74 | 69.1 | 0.35 |
| 3 | 39 | 45.7 | 0.98 |
| 4+5 | 19 | 17.1 | 0.21 |
| Total | 200 | 200.0 | 2.69 |
π Definition β Chi-Square Test of Goodness of Fit: A hypothesis test that compares observed frequencies with expected frequencies from a theoretical distribution to determine if the theoretical distribution fits the observed data well.
Important Rule: Expected frequency for any category must not be less than 5. Categories with expected frequencies less than 5 must be merged with adjacent categories. Here, x=5 (ei=2.0) was merged with x=4 (ei=15.1).
Degrees of freedom = k β 1 β r = 5 β 1 β 1 = 3, where k=5 (merged categories) and r=1 (one parameter p estimated).
The critical value ΟΒ²0.05(3) = 7.82. Since computed ΟΒ² = 2.69 < 7.82, we accept H0 and conclude the binomial distribution fits the data well.
β Key Takeaways
The RCB design ANOVA partitions total variation into treatment, block, and error components, allowing simultaneous testing of treatment effects and block effects with specific degrees of freedom formulas. The LSD test provides a single threshold value for comparing all pairs of treatment means after a significant ANOVA result, with means differing by more than the LSD considered significantly different. The Chi-Square Goodness of Fit test uses the statistic ΟΒ² = Ξ£[(oβe)Β²/e] with (kβ1βr) degrees of freedom, where categories must be merged if expected frequencies are less than 5. A computed ΟΒ² less than the critical value indicates a good fit, meaning the theoretical distribution adequately represents the observed data. Blocking is beneficial only when block means are significantly different; otherwise, a Completely Randomized Design is preferred as it preserves more error degrees of freedom.
π§ Quick Revision Questions
- What are the degrees of freedom for error in an RCB design with r blocks and c treatments?
- What is the formula for the Least Significant Difference, and what does each symbol represent?
- Why must expected frequencies in a chi-square goodness of fit test not be less than 5?
- In the chi-square goodness of fit test, how are the degrees of freedom calculated when parameters are estimated from the data?
- What conclusion should be drawn if the computed F-value for blocks in an RCB design is less than the critical F-value?
π Lecture 45 β Chi-Square Test of Goodness of Fit (in continuation of the last lecture) β’ Chi-Square Test of Independence β’ The Concept of Degrees of Freedom β’ p-value β’ Relationship Between Confidence; Interval and Tests of Hypothesis An Overview of the Science of Statistics in Todayβs World (including Latest Definition of Statistics)
π Overview: This lecture continues the discussion of the Chi-Square Test of Goodness of Fit, applying it to a Poisson distribution example. It then introduces the Chi-Square Test of Independence for analyzing associations between two categorical variables. The lecture also explains the fundamental concept of degrees of freedom, introduces the p-value method for hypothesis testing, explores the relationship between confidence intervals and hypothesis tests, and concludes with an overview of modern statistics.
ποΈ Topics Covered
The lecture covers the chi-square test of goodness of fit applied to a Poisson distribution example, including the step-by-step hypothesis testing procedure and the rationale behind the test. It then introduces the chi-square test of independence using contingency tables and examples. The concept of degrees of freedom is explained through geometric and algebraic analogies, followed by the definition and application of the p-value method. The lecture concludes with the relationship between confidence intervals and hypothesis tests, and provides an overview and latest definition of statistics.
π Lecture Summary
Chi-Square Test of Goodness of Fit (Continuation)
The lecture continues from the previous lecture's example of fitting a binomial distribution, now applying the chi-square test of goodness of fit to determine if customer arrivals at an airline terminal follow a Poisson distribution. The example uses data on the frequency of arrivals per minute. The process involves estimating the Poisson parameter (mean) from the sample data, calculating expected Poisson probabilities, and then comparing observed and expected frequencies using the chi-square statistic.
π Definition β Chi-Square Test of Goodness of Fit: A statistical test used to determine how well an observed frequency distribution fits an expected theoretical distribution.
π Formula: The test statistic is ( \chi^2 = \sum \frac{(o_i - e_i)^2}{e_i} ), where ( o_i ) is the observed frequency and ( e_i ) is the expected frequency for category ( i ). This statistic, if the null hypothesis is true, follows a chi-square distribution with ( k - 1 - r ) degrees of freedom, where ( k ) is the number of categories after merging and ( r ) is the number of parameters estimated from the sample.
π Example: Data on customer arrivals per minute was collected (n=400). The sample mean was calculated as ( \bar{x} = \frac{800}{400} = 2 ). Using this, Poisson probabilities were computed [e.g., ( P(x=0) = \frac{e^{-2} 2^0}{0!} = 0.1353 )]. Expected frequencies were found by multiplying probabilities by 400. Because some expected frequencies were less than 5, the last four categories (arrivals 6, 7, 8, 9 or more) were combined, resulting in ( k = 7 ) effective categories.
- Hypotheses: ( H_0 ): Arrivals are Poisson-distributed; ( H_1 ): The distribution is not Poisson.
- Level of Significance: ( \alpha = 0.05 )
- Degrees of Freedom: Since one parameter (the mean) was estimated from the sample, ( r = 1 ). So, df = ( k - 1 - r = 7 - 1 - 1 = 5 ).
- Critical Value: ( \chi^2_{0.05}(5) = 11.07 )
- Computed Statistic: The sum of ( (o-e)^2/e ) across all categories yielded ( \chi^2 = 78.88 ).
- Conclusion: Since 78.88 > 11.07, we reject ( H_0 ) and conclude that the distribution is likely not a Poisson distribution with parameter 2. The large chi-square value indicates a very poor fit.
π‘ Why this matters: This procedure is fundamental for validating model assumptions in real-world data. A poor fit means the assumed probability model (e.g., Poisson) is not suitable for the data.
Assumptions of the Chi-Square Test of Goodness of Fit:
- The total sample size (n) should be at least 50.
- The expected frequency (( e_i )) in any category should not be less than 5. Categories with ( e_i < 5 ) must be combined with adjacent categories.
- Observations in the sample (or frequencies of categories) must be independent.
Chi-Square Test of Independence
This test determines whether two categorical variables of classification are associated or independent. It uses a contingency table and a formula very similar to the goodness-of-fit test.
π Definition β Chi-Square Test of Independence: A statistical test used to determine if there is a significant association between two categorical variables in a population.
π Formula: The test statistic is ( \chi^2 = \sum_i \sum_j \frac{(o_{ij} - e_{ij})^2}{e_{ij}} ). This statistic, if ( H_0 ) is true, follows a chi-square distribution with ( (r-1)(c-1) ) degrees of freedom, where ( r ) and ( c ) are the number of rows and columns in the contingency table.
π Definition β Expected Frequency in a Contingency Table: The expected frequency for any cell is calculated as: ( e_{ij} = \frac{\text{(Row Total)} \times \text{(Column Total)}}{\text{Grand Total}} ).
π Example: A sample of 250 men and 250 women were asked if they want a PC. The observed frequencies were: Men-Want (120), Men-Donβt Want (130), Women-Want (80), Women-Donβt Want (170).
- Hypotheses: ( H_0 ): Gender and desire for PC are independent; ( H_1 ): They are not independent.
- Significance Level: ( \alpha = 0.05 )
- Degrees of Freedom: ( (r-1)(c-1) = (2-1)(2-1) = 1 )
- Computations:
- Expected frequency for Men-Want: ( e_{11} = (200 \times 250) / 500 = 100 )
- Expected frequency for Women-Want: ( e_{12} = (200 \times 250) / 500 = 100 )
- Expected frequency for Men-Donβt Want: ( e_{21} = (300 \times 250) / 500 = 150 )
- Expected frequency for Women-Donβt Want: ( e_{22} = (300 \times 250) / 500 = 150 )
- Computed Statistic: ( \chi^2 = 4.00 + 2.67 + 4.00 + 2.67 = 13.33 )
- Critical Region: ( \chi^2 \ge \chi^2_{0.05}(1) = 3.84 )
- Conclusion: Since 13.33 > 3.84, we reject ( H_0 ) and conclude that desire to own a PC and sex are associated. The data shows the proportion wanting a PC is higher among men.
π Second Example: A ( 4 \times 3 ) contingency table of marital status (Single, Married, Widowed, Divorced) and smoking pattern (Abstinence, Only at times, Regular Smoker) is presented to test for independence. Students are encouraged to work on this problem.
The Concept of Degrees of Freedom
Degrees of freedom (df) can be understood as the number of values in a calculation that are free to vary, given certain constraints.
- Geometric Analogy: A line segment fixed at one point in a plane has 1 degree of freedom (it can rotate). A line segment fixed at both ends has 0 degrees of freedom in the plane.
- Statistical Analogy: For a sample of 6 observations with a fixed sum of 20, if you freely choose the first 5 values, the 6th value is determined. Therefore, you have ( n - 1 = 5 ) degrees of freedom.
π Definition β Degrees of Freedom in Sampling Distributions: The number of observations in the sample minus the number of population parameters that are estimated from the sample data.
- For t-distribution (( t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} )): df = ( n-1 ) (one parameter, ( \sigma ), is estimated).
- For F-distribution (( F = s_1^2 / s_2^2 )): df = ( (n_1 - 1, n_2 - 1) ) (the variance parameter for each population is estimated).
- For Chi-Square Test of Independence (( \chi^2 ) for ( r \times c ) contingency table): df = ( (r-1)(c-1) ). In a ( 2 \times 2 ) table, given the marginal and grand totals, only one cell frequency can be freely chosen, so df = 1.
p-value
The p-value is an alternative method for hypothesis testing that indicates the strength of evidence against the null hypothesis.
π Definition β p-value: The probability of observing a sample value as extreme as, or more extreme than, the value observed, given that the null hypothesis is true.
Decision Rule: If the p-value is less than the level of significance ( \alpha ), we reject ( H_0 ). If the p-value is greater than ( \alpha ), we do not reject ( H_0 ).
π Example: In the two-tailed z-test comparing hourly wages of computer analysts and nurses, the calculated test statistic was ( z = 3.43 ). Using the standard normal table:
- ( P(Z > 3.43) = 0.5000 - 0.4996 = 0.0004 )
- p-value = ( P(Z < -3.43) + P(Z > 3.43) = 0.0004 + 0.0004 = 0.0008 ).
- Since the p-value (0.0008) is less than ( \alpha = 0.02 ), we reject ( H_0 ). The result is highly improbable if the null hypothesis were true.
Relationship Between Confidence Interval and Tests of Hypothesis
There is a direct duality between a confidence interval for a parameter ( \theta ) and a two-tailed test of hypothesis about ( \theta ).
π Definition β Proposition: Let [L, U] be a ( 100(1 - \alpha)% ) confidence interval for a parameter ( \theta ).
- We accept the null hypothesis ( H_0: \theta = \theta_0 ) at the ( \alpha ) level of significance if ( \theta_0 ) falls inside the interval [L, U].
- We reject ( H_0: \theta = \theta_0 ) at the ( \alpha ) level of significance if ( \theta_0 ) falls outside the interval [L, U].
- The confidence interval [L, U] is the acceptance region. The region outside is the rejection (or critical) region.
An Overview of the Science of Statistics in Todayβs World
The lecture concludes by noting that this course covered fundamental concepts, but the field of statistics is vast, including topics like Latin Square Design, inference for regression, and non-parametric statistics. Many of the numerical problems demonstrated can be solved quickly using statistical software packages like SPSS, SAS, Minitab, etc.
Latest Definition of Statistics: Statistics is a science of decision making for governing state affairs. It collects, analyzes, manages, monitors, interprets, evaluates, and validates information. Statistics is Information Science and Information Science is Statistics. It is an applicable science whose tools are applied to all sciences, including humanities and social sciences.
β Key Takeaways
- The chi-square test of goodness of fit compares observed frequencies to expected frequencies from a theoretical distribution (e.g., Poisson, Binomial), and requires merging categories so that all expected frequencies are at least 5.
- The chi-square test of independence determines if two categorical variables are associated, using a contingency table and calculating expected frequencies by multiplying the appropriate marginal totals and dividing by the grand total.
- Degrees of freedom are the number of values free to vary in a calculation. For the goodness of fit test, it's ( k-1-r ); for the test of independence, it's ( (r-1)(c-1) ).
- The p-value is the probability of observing your data (or more extreme) if the null hypothesis is true. A small p-value (less than ( \alpha )) provides evidence against the null hypothesis.
- There is a direct relationship between a two-tailed hypothesis test and a confidence interval: if the hypothesized value falls within the ( 100(1-\alpha)% ) confidence interval, you fail to reject the null hypothesis at the ( \alpha ) level of significance.
π§ Quick Revision Questions
- What is the condition for merging categories in a chi-square goodness of fit test?
- How is the expected frequency for a cell in a contingency table calculated for the test of independence?
- Define degrees of freedom in the context of a t-test or a chi-square test.
- What is the decision rule for rejecting a null hypothesis using the p-value method at a significance level ( \alpha )?
- If a 95% confidence interval for ( \mu ) is (10, 20), what would be the conclusion of a two-tailed test of ( H_0: \mu = 22 ) at ( \alpha = 0.05 )?