Beginning R: An Introduction to Statistical Programming by Larry Pace
Author:Larry Pace [Pace, Larry]
Language: eng
Format: epub, pdf
Tags: Computers, Statistics, Mathematical & Statistical Software, Business & Economics
ISBN: 9781430245544
Publisher: Apress
Published: 2012-10-17T04:00:00+00:00
Figure 10-1. Comparing F distributions with different degrees of freedom
Using the F Distribution to Test Variances
Because it is formed from the ratio of two variances, the F distribution can be used to test hypotheses about variances. In theoretical statistics books, students learn that the F and chi-square distributions have a mathematical connection, so it makes some sense that we develop confidence intervals for variances using the chi-square distribution and hypothesis tests about variances using the F distribution. In Chapter 9, you saw the use of the var.test function to compare two variances. Recall that the output of the var.test function is an F ratio.
Here is the result of the var.test function used to assess equality of variance from Chapter 9.
> var.test(PostTest ∼ Class)
F test to compare two variances
data: PostTest by Class
F = 0.3046, num df = 20, denom df = 15, p-value = 0.01435
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.1105144 0.7836799
sample estimates:
ratio of variances
0.3045669
Note the F ratio is less than 1 because the smaller variance was divided by the larger one. Such an F ratio is perfectly legitimate, but many students and researchers are thrown off by a “left-tailed” probability value in the F distribution. An easy way to avoid this is simply to divide the larger variance by the smaller one to make F at least 1 and the p value a “right-tailed” one. Recall that the variances for the two classes were 77.46 and 254.34, respectively:
> tapply(PostTest, Groups, var)
1 2
77.46362 254.34028
Let us divide the larger variance by the smaller one to get an F ratio greater than one: 254.34028 / 77.46362 = 3.283351. We can also simply find the reciprocal of the F ratio reported by the var.test function:
> 1/.3045669
[1] 3.283351
The p value will be the same whether we divide the larger or the smaller variance by the other. Note that this is a two-tailed probability because the alternative hypothesis is that the variances are unequal. Thus, we would double the one-tailed p value reported by R when we use the pf() function to determine the p value. See the following R code:
> TwoTailedP <− 2*(1 - pf(3.283351, 15, 20))
> TwoTailedP
[1] 0.01435193
Note that we had to reverse the numerator and denominator degrees of freedom, as we are now dividing the larger variance by the smaller one. The two-tailed p value is indeed the same as that reported by R’s var.test function.
For the analysis of variance, we place 1 – α to the left of a critical value of F and α to the right of the critical value. This leads some teachers erroneously to conclude that the F test is one-tailed. The test of hypothesis is based on a ratio of two variances, and variances are based on squared deviations, as we discussed above. For that reason, a negative difference between two means and a positive difference between two means will both produce a positive squared deviation. Therefore the F ratio increases as the differences (both positive and negative) between means
Download
Beginning R: An Introduction to Statistical Programming by Larry Pace.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9914)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Windows APT Warfare by Sheng-Hao Ma(6825)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6555)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6423)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Kotlin in Action by Dmitry Jemerov(5062)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4316)
Functional Programming in JavaScript by Mantyla Dan(4038)
Solidity Programming Essentials by Ritesh Modi(3995)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3786)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3730)
The Ultimate iOS Interview Playbook by Avi Tsadok(3705)
