1 / 50

Dr. Ka-fu Wong

Dr. Ka-fu Wong. ECON1003 Analysis of Economic Data. Chapter Ten. An alysis o f Va riance. GOALS. Discuss the general idea of analysis of variance. List the characteristics of the F distribution.

Download Presentation

Dr. Ka-fu Wong

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. Dr. Ka-fu Wong ECON1003 Analysis of Economic Data

  2. Chapter Ten Analysis of Variance GOALS • Discuss the general idea of analysis of variance. • List the characteristics of the F distribution. • Conduct a test of hypothesis to determine whether the variances of two populations are equal. • Organize data into a one-way and a two-way ANOVA table. • Define and understand the terms treatments and blocks. • Conduct a test of hypothesis among three or more treatment means. • Develop confidence intervals for the difference between treatment means. • Conduct a test of hypothesis to determine if there is a difference among block means. l

  3. Two Sample Tests TEST FOR EQUAL VARIANCES TEST FOR EQUAL MEANS Ho Ho Population 1 Population 1 Population 2 Population 2 H1 H1 Population 1 Population 2 Population 1 Population 2

  4. Characteristics of F-Distribution • There is a “family” of F Distributions. • Each member of the family is determined by two parameters: the numerator degrees of freedom and the denominator degrees of freedom. • F cannot be negative, and it is a continuous distribution. • The F distribution is positively skewed. • Its values range from 0 to . As F   the curve approaches the X-axis.

  5. Not symmetric (skewed to the right) a F 0 1.0 Nonnegative values only The F-Distribution, F(m,n) Each member of the family is determined by two parameters: the numerator degrees of freedom (m) and the denominator degrees of freedom (n).

  6. Test for Equal Variances • For the two tail test, the test statistic is given by:where s12 and s22 are the sample variances for the two samples. • The null hypothesis is rejected at a level of significance if the computed value of the test statistic is greater than the critical value with a confidence level a/2 and numerator and denominator dfs.

  7. Test for Equal Variances • For the one tail test, the test statistic is given by:where s12 and s22 are the sample variances for the two samples. • The null hypothesis is rejected at a level of significance if the computed value of the test statistic is greater than the critical value with a confidence level a and numerator and denominator dfs.

  8. EXAMPLE 1 • Colin, a stockbroker at Critical Securities, reported that the mean rate of return on a sample of 10 internet stocks was 12.6 percent with a standard deviation of 3.9 percent. The mean rate of return on a sample of 8 utility stocks was 10.9 percent with a standard deviation of 3.5 percent. At the .05 significance level, can Colin conclude that there is more variation in the software stocks?

  9. EXAMPLE 1 continued • Step 1:The hypotheses are: • Step 2: The significance level is .05. • Step 3:The test statistic is the F distribution. • Step 4:H0 is rejected if F>3.68. The degrees of freedom are 9 in the numerator and 7 in the denominator. • Step 5:The value of F is H0 is not rejected. There is insufficient evidence to show more variation in the internet stocks.

  10. Analysis of Variance(ANOVA)

  11. Underlying Assumptions for ANOVA • The F distribution is also used for testing whether two or more sample means came from the same or equal populations. • if any group mean differs from the mean of all groups combined • Answers: “Are all groups equal or not?” • This technique is called analysis of variance or ANOVA. • ANOVA requires the following conditions: • The sampled populations follow the normal distribution. • The populations have equal standard deviations. • The samples are randomly selected and are independent.

  12. The hypothesis • Suppose that we have independent samples of n1, n2, . . ., nK observations from K populations. If the population means are denoted by 1, 2, . . ., K, the one-way analysis of variance framework is designed to test the null hypothesis

  13. Sample Observations from Independent Random Samples of K Populations Same !! unequal !! Unequal number of observations in the K samples in general. nT=n1+…+nK

  14. Sum of Squares Decomposition for one-way analysis of variance • Suppose that we have independent samples of n1, n2, . . ., nK observations from K populations. • Denote bythe K group sample means and by the overall sample mean. We define the following sum of squares: where xij denotes the jth sample observation in the ith group.

  15. An Numerical Example of Sum of Squares Decomposition SSTotal = SST + SSE

  16. A proof of SSTotal = SST + SSE

  17. Two Ways to estimate the population variance • Note that the variance is assumed to be identical across populations • If the population means are identical, we have two ways to estimate the population variance • Based on the K sample variances. • Based on the deviation of the K sample means from the grand mean.

  18. An estimate the population variance based on sample variances • Anyone of the K sample variances can be used to estimate the population. • We can get a more precise estimate if we use all the information from the K samples.

  19. An estimate the population variance based on deviation of the K sample means from the grand sample mean. • If the sample sizes are the same for all samples, the Central Limit Theorem suggests that sample mean will be distributed normally with the population mean and the population variance divided by sample size. ??? • When sample sizes are different across samples, we will have to weight

  20. Comparing the Variance Estimates: The F Test • If the null hypothesis is true and the ANOVA assumptions are valid, the sampling distribution of ratio of the two variance estimates follows F distribution with K - 1 and nT - K. • If the means of the K populations are not equal, the value of F-stat will be inflated because SST/(K-1) will overestimate s2. • Hence, we will reject H0 if the resulting value of F-stat appears to be too large to have been selected at random from the appropriate F distribution.

  21. Test for the Equality of k Population Means • Hypotheses H0: m1=m2=m4=….=mk H1: Not all population means are equal • Test Statistic F = [SST/(K-1)] / [SSE/(nT-K)] • Rejection Rule Reject H0 if F > F where the value of F is based on an F distribution with k - 1 numerator degrees of freedom and nT - K denominator degrees of freedom.

  22. Sampling Distribution of MST/MSE The figure below shows the rejection region associated with a level of significance equal to  where F denotes the critical value. Reject H0 MST/MSE F Do Not Reject H0 Critical Value

  23. The ANOVA Table

  24. Does learning method affect student’s exam scores? • Consider 3 methods: • standard • osmosis • shock therapy • Convince 15 students to take part. Assign 5 students randomly to each method. • Wait eight weeks. Then, test students to get exam scores. • Are the three learning methods equally effective? • i.e., are their population means of exam scores same?

  25. “Analysis of Variance” (Study #1) The variation between the group means and the grand mean is larger than the variation within each of the groups.

  26. ANOVA Table for Study #1 “F” means “F test statistic” One-way Analysis of Variance Source DF SS MS F P Factor 2 2510.5 1255.3 93.44 0.000 Error 12 161.2 13.4 Total 14 2671.7 P-Value “Source” means “find the components of variation in this column” “DF” means “degrees of freedom” “SS” means “sums of squares” “MS” means “mean squared”

  27. ANOVA Table for Study #1 One-way Analysis of Variance Source DF SS MS F P Factor 2 2510.5 1255.3 93.44 0.000 Error 12 161.2 13.4 Total 14 2671.7 “Factor” means “Variability between groups” or “Variability due to the factor of interest” “Error” means “Variability within groups” or “unexplained random variation” “Total” means “Total variation from the grand mean”

  28. ANOVA Table for Study #1 One-way Analysis of Variance Source DF SS MS F P Factor 2 2510.5 1255.3 93.44 0.000 Error 12 161.2 13.4 Total 14 2671.7 1255.2 = 2510.5/2 13.4 = 161.2/12 14 = 2 + 12 93.44 = 1255.3/13.4 2671.7 = 2510.5 + 161.2

  29. “Analysis of Variance” (Study #2) The variation between the group means and the grand mean is smaller than the variation within each of the groups.

  30. ANOVA Table for Study #2 One-way Analysis of Variance Source DF SS MS F P Factor 2 80.1 40.1 0.46 0.643 Error 12 1050.8 87.6 Total 14 1130.9 The P-value is pretty large so cannot reject the null hypothesis. There is insufficient evidence to conclude that the average exam scores differ for the three learning methods.

  31. Do Holocaust survivors have more sleep problems than others?

  32. ANOVA Table for Sleep Study One-way Analysis of Variance Source DF SS MS F P Factor 2 1723.8 861.9 61.69 0.000 Error 117 1634.8 14.0 Total 119 3358.6 The P-value is so small that we reject the null hypothesis of equal population means and favor the alternative hypothesis that at least one pair of population means are different.

  33. Potential problem with the analysis • What is driving the rejection of null of equal population means? • From the plot, the Healthy and Depress seem to have different mean sleep quality. It looks like that the rejection is due to the difference between these two groups. • If we pooled Healthy and Depress, the distribution will look more like Survivor. That is, an acceptance of the null is more likely. • This example illustratse that we have to be careful about our analysis and interpretation of the result when we conduct a test of equal population means.

  34. EXAMPLE 2 • Rosenbaum Restaurants specialize in meals for senior citizens. Katy Polsby, President, recently developed a new meat loaf dinner. Before making it a part of the regular menu she decides to test it in several of her restaurants. She would like to know if there is a difference in the mean number of dinners sold per day at the Anyor, Loris, and Lander restaurants. Use the .05 significance level.

  35. Example 2 continued

  36. EXAMPLE 2 continued • Step 1:H0: m1 = m2 = m3 H1: Treatment means are not the same • Step 2:H0 is rejected if F>4.10. There are 2 df in the numerator and 10 df in the denominator.

  37. Example 2 continued • To find the value of F: • The decision is to reject the null hypothesis. • The treatment means are not the same. • The mean number of meals sold at the three locations is not the same.

  38. Inferences About Treatment Means • When we reject the null hypothesis that the means are equal, we may want to know which treatment means differ. • One of the simplest procedures is through the use of confidence intervals.

  39. Confidence Interval for the Difference Between Two Means • where t is obtained from the t table with degrees of freedom (nT - k). • MSE = [SSE/(nT - k)] because

  40. EXAMPLE 3 • From EXAMPLE 2 develop a 95% confidence interval for the difference in the mean number of meat loaf dinners sold in Lander and Aynor. Can Katy conclude that there is a difference between the two restaurants? • Because zero is not in the interval, we conclude that this pair of means differs. • The mean number of meals sold in Aynor is different from Lander.

  41. Two-Factor ANOVA • For the two-factor ANOVA we test whether there is a significant difference between the treatment effect and whether there is a difference in the blocking effect.

  42. Sample Observations from Independent Random Samples of K Populations

  43. Sum of Squares Decomposition for Two-Way Analysis of Variance • Suppose that we have a sample of observations with xij denoting the observation in the ith group and jth block. Suppose that there are K groups and B blocks, for a total of n = KH observations. Denote the group sample means by , • the block sample means by and the overall sample mean by x. SSTotal = SSE+SST+SSB

  44. General Format of Two-Way Analysis of Variance Table

  45. EXAMPLE 4 • The Bieber Manufacturing Co. operates 24 hours a day, five days a week. The workers rotate shifts each week. Todd Bieber, the owner, is interested in whether there is a difference in the number of units produced when the employees work on various shifts. A sample of five workers is selected and their output recorded on each shift. At the .05 significance level, can we conclude there is a difference in the mean production by shift and in the mean production by employee?

  46. EXAMPLE 4 continued

  47. EXAMPLE 4 continued • TREATMENT EFFECT • Step 1:H0: µ1= µ2= µ3 versus H1: Not all means are equal. • Step 2:H0 is rejected ifF>4.46, the degrees of freedom are 2 and 8.

  48. Example 4 continued • Step 3: Compute the various sum of squares: • Step 4:H0 is rejected. There is a difference in the mean number of units produced for the different time periods.

  49. EXAMPLE 4 continued • Block Effect: • Step 1:H0: µ1= µ2= µ3 = µ4 = µ5 versus H1: Not all means are equal. • Step 2:H0 is rejected ifF>3.84, the degrees of freedom are 4 and 8. • Step 3: F=[33.73/4]/[43.47/8]=1.55 • Step 4:H0 is not rejected since there is no significant difference in the average number of units produced for the different employees.

  50. Chapter Ten Analysis of Variance - END -

More Related