{"id":2855,"date":"2012-11-29T03:29:59","date_gmt":"2012-11-29T08:29:59","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=2855"},"modified":"2014-09-05T12:56:19","modified_gmt":"2014-09-05T17:56:19","slug":"the-f-statistic-in-anova-explained","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/the-f-statistic-in-anova-explained\/","title":{"rendered":"The F-statistic in ANOVA explained"},"content":{"rendered":"<p>I tried to find an easily comprehended explanation of the F-statistic for my students but I could not, so, here as a public service is mine. If you have some other pages you can recommend, please let me know.<\/p>\n<p>Okay, why ANOVA? Why not just do a t-test? Well, let&#8217;s say you have five groups. Then you will have ten pairwise comparisons. You compare group 1 to groups 2, 3, 4 and 5. That&#8217;s four. Now you compare group 2 to groups 3, 4 and 5. That&#8217;s another three t-tests. And so on. So now, you don&#8217;t really have a 5% probability of a type I error when\u00a0 p = .05 because you actually had TEN tests. If you did 100 tests, you&#8217;d expect five of them to turn out significant just by chance. So, let&#8217;s just accept that many pairwise tests = bad.<\/p>\n<p>Enter ANOVA, short for Analysis of Variance. Let&#8217;s talk about a one-way ANOVA for now. You have a continuous, numeric dependent variable &#8211; say height. You have a categorical independent variable with two or more levels. You could do ANOVA with just two levels but in that case you might as well do a t-test. In this case, let&#8217;s assume that we have children raised eating an unrestricted diet, children who were raised vegetarian and children who were raised vegan. At age 10, we decide to measure all of their heights.<\/p>\n<p>What is our null hypothesis? It is that there is no difference among the means, or<\/p>\n<p>\u03bc1 = \u03bc2 = \u03bc3<\/p>\n<p>Enter the F-test. We are going to state that if there is no difference in the means then the estimate of variance you get from the difference in group means should be the same as the estimate of the population variance you get within groups. The F statistic is calculated like this<\/p>\n<p style=\"text-align: center;\"><strong><span style=\"text-decoration: underline;\">variance between groups<\/span><\/strong><br \/>\n<strong>variance within groups<\/strong><\/p>\n<p>If the null hypothesis is correct, these two estimates of the variance should be close to the same and your F ratio should be near 1.0<\/p>\n<p><strong>How to get the within group variance<\/strong><\/p>\n<p>Well, it&#8217;s just like any other time you get a variance. Imagine that group 1 is a sample for a study. What do you do? You sum the squared deviations for the mean and divide by n minus 1, right?<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/variancegroup11.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2861\" title=\"variancegroup11\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/variancegroup11.gif\" alt=\"variance group 1\" width=\"235\" height=\"127\" \/><\/a><\/p>\n<p>That gives you the within group variance for group 1. You do the same thing for group 2 and group 3.<\/p>\n<p>BUT &#8230; not all groups are created equal. What if you have five times as many people in group 3 as you do in group1 and group 2?<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/weightedwithin.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2857\" title=\"\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/weightedwithin-300x73.gif\" alt=\"weighted average of group variances\" width=\"300\" height=\"73\" srcset=\"https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/weightedwithin-300x73.gif 300w, https:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/weightedwithin.gif 738w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Being the reasonable person you are, you weight the within group variances by the degrees of freedom of each group, that is to say, the number of subjects minus 1. You divide this by the total number of subjects minus the number of groups. This is your within group estimate of the variance. This is your denominator.\u00a0\u00a0 Let&#8217;s say that the value you get for this is 42.<\/p>\n<p><strong>Now you need the between groups variance\u00a0<\/strong><\/p>\n<p>First, subtract each group mean from the overall mean. Square that.<br \/>\nSecond, multiply by the number in each group<br \/>\nThird, add the result<br \/>\nFourth, divide by the number of groups minus 1<\/p>\n<p><a href=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/betweengroup.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2858\" title=\"\" src=\"http:\/\/www.thejuliagroup.com\/blog\/wp-content\/uploads\/2012\/11\/betweengroup.gif\" alt=\"between group variance\" width=\"239\" height=\"135\" \/><\/a><\/p>\n<p>Let&#8217;s just suppose, for the sake of supposing, that the value you get for this is 108. Your F-ratio is then 108\/42 =\u00a0 2.57<\/p>\n<p>And that, my dears is you get an F value.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I tried to find an easily comprehended explanation of the F-statistic for my students but I could not, so, here as a public service is mine. If you have some other pages you can recommend, please let me know. Okay, why ANOVA? Why not just do a t-test? Well, let&#8217;s say you have five groups&#8230;.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2855","post","type-post","status-publish","format-standard","hentry","category-statistics"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=2855"}],"version-history":[{"count":4,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2855\/revisions"}],"predecessor-version":[{"id":4244,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2855\/revisions\/4244"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=2855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=2855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=2855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}