Easy Way to Understand Degrees of Freedom
How to Find Degrees of Freedom | Definition & Formula
Degrees of freedom, often represented by v or df, is the number of independent pieces of information used to calculate a statistic. It's calculated as the sample size minus the number of restrictions.
Degrees of freedom are normally reported in brackets beside the test statistic, alongside the results of the statistical test.
What are degrees of freedom?
In inferential statistics, you estimate a parameter of a population by calculating a statistic of a sample. The number of independent pieces of information used to calculate the statistic is called the degrees of freedom. The degrees of freedom of a statistic depend on the sample size:
- When the sample size is small, there are only a few independent pieces of information, and therefore only a few degrees of freedom.
- When the sample size is large, there are many independent pieces of information, and therefore many degrees of freedom.
When you estimate a parameter, you need to introduce restrictions in how values are related to each other. As a result, the pieces of information are not all independent. To put it another way, the values in the sample are not all free to vary.
The following analogy and example show you what it means for a value to be free to vary and how it's affected by restrictions.
Free to vary: Dessert analogy
Free to vary: Sum example
Degrees of freedom and hypothesis testing
The degrees of freedom of a test statistic determines the critical value of the hypothesis test. The critical value is calculated from the null distribution and is a cut-off value to decide whether to reject the null hypothesis.
The degrees of freedom affect the critical value by changing the shape of the null distribution. The null distributions of Student's t, chi-square, and other test statistics change with the degrees of freedom, but they each change in different ways.
Student's t distribution
To perform a t test, you calculate t for the sample and compare it to a critical value. To find the right critical value, you need to use the Student's t distribution with the appropriate degrees of freedom.
The null distribution of Student's t changes with the degrees of freedom:
- When df = 1, the distribution is strongly leptokurtic, meaning the probability of extreme values is greater than in a normal distribution.
- As the df increases, the distribution becomes narrower and less leptokurtic. It becomes increasing similar to a standard normal distribution
- When df ≥ 30, Student's t distribution is almost the same as a standard normal distribution. If you have a sample size of greater than 30, you can use the standard normal distribution (also known as the z distribution) instead of Student's t distribution.
This change in the distribution's shape makes intuitive sense. The t distribution has less spread as the number of degrees of freedom increases because the certainty of the estimate increases. Imagine repeatedly sampling the population and calculating Student's t; the larger the sample size, the less the test statistic will vary between samples.
Chi-square distribution
To perform a chi-square test, you compare a sample's chi-square to a critical value. To find the right critical value, you need to use the chi-square distribution with the appropriate degrees of freedom.
The null distribution of chi-square changes with the degrees of freedom, but in a different way than Student's t distribution:
- When df < 3, the probability distribution is shaped like a backwards "J."
- When df ≥ 3, the probability distribution is hump-shaped, with the peak of the hump located at Χ2 = df − 2. The hump is right-skewed, meaning that the distribution is longer on the right side of its peak.
- When df > 90, the chi-square distribution is approximated by a normal distribution.
Receive feedback on language, structure and formatting
Professional editors proofread and edit your paper by focusing on:
- Academic style
- Vague sentences
- Grammar
- Style consistency
See an example
How to calculate degrees of freedom
The degrees of freedom of a statistic is the sample size minus the number of restrictions. Most of the time, the restrictions are parameters that are estimated as intermediate steps in calculating the statistic.
n − r
Where:
- n is the sample size
- r is the number of restrictions, usually the same as the number of parameters estimated
The degrees of freedom can't be negative. As a result, the number of parameters you estimate can't be larger than your sample size.
Test-specific formulas
It can be difficult to figure out the number of restrictions. It's often easier to use test-specific formulas to figure out the degrees of freedom of a test statistic.
The table below gives formulas to calculate the degrees of freedom for several commonly-used tests.
Test | Formula | Notes |
---|---|---|
One-sample t test | df = n − 1 | |
Independent samples t test | df = n1 + n2 − 2 | Where n1 is the sample size of group 1 and n 2 is the sample size of group 2 |
Dependent samples t test | df = n − 1 | Where n is the number of pairs |
Simple linear regression | df = n − 2 | |
Chi-square goodness of fit test | df = k − 1 | Where k is the number of groups |
Chi-square test of independence | df = (r − 1) * (c − 1) | Where r is the number of rows (groups of one variable) and c is the number of columns (groups of the other variable) in the contingency table |
One-way ANOVA | Between-group df = k − 1 Within-group df = N − k Total df = N − 1 | Where k is the number of groups and N is the sum of all groups' sample sizes |
Frequently asked questions about degrees of freedom
Sources in this article
We strongly encourage students to use sources in their work. You can cite our article (APA Style) or take a deep dive into the articles below.
This Scribbr article
Is this article helpful?
You have already voted. Thanks :-) Your vote is saved :-) Processing your vote...
Source: https://www.scribbr.com/statistics/degrees-of-freedom/
0 Response to "Easy Way to Understand Degrees of Freedom"
Post a Comment