The test statistic in an ANOVA test follows the F-distribution. The F-distribution graph is not symmetric, and its shape depends on two parameters dfn and dfd.
dfn = degrees of freedom while calculating the estimate of the variance of the numerator and dfd = degrees of freedom while calculating the estimate of the variance of the denominator
In a one-way ANOVA test,
dfn = (total number of groups – 1) And dfd = (total number of observations – total number of groups)
We can use the following Python code to generate the F-distribution graph for dfn = 10 and dfd = 50.
from scipy.stats import f import numpy from matplotlib import pyplot X = numpy.linspace(0, 5, 200) dfn = 10 dfd = 50 Y = f.pdf(X, dfn, dfd) pyplot.plot(X, Y) pyplot.savefig("f-dist.png") pyplot.close()
Here, we are using the numpy.linspace() function to generate 200 equally spaced points on the x-axis within the range 0 to 5. After that, we are using the f.pdf() function from the scipy.stats module to generate the corresponding points on the y-axis.
The output graph of the above program will look like the following: …






0 Comments