**Degrees of Freedom Formula (Table of Contents)**

## What is the Degrees of Freedom Formula?

The term “Degrees of Freedom” refers to the statistical indicator that shows how many variables in a data set can be changed while abiding by certain constraints. In other words, the degree of freedom indicates the number of variables that need to be estimated in order to complete a data set. It finds extensive use in probability distributions, hypothesis testing, and regression analysis.

The formula for degrees of freedom for single variable samples, such as 1-sample t-test with sample size N, can be expressed as sample size minus one. Mathematically, it is represented as,

**Degree of Freedom = N – 1**

The formula for degrees of freedom for two-variable samples, such as the Chi-square test with R number of rows and C number of columns, can be expressed as the product of a number of rows minus one and number of columns minus one. Mathematically, it is represented as,

**Degree of Freedom = (R – 1) * (C – 1)**

**Example of Degrees of Freedom Formula (With Excel Template)**

Let’s take an example to understand the calculation of Degrees of Freedom in a better manner.

#### Degrees of Freedom Formula – Example #1

**Let us take the example of a sample (data set) with 8 values with the condition that the mean of the data set should be 20. Then the degree of freedom of the sample can be derived as,**

Degrees of Freedom is calculated using the formula given below

4.6 (4,852 ratings)

View Course

**Degree of Freedom = N – 1**

- Degrees of Freedom = 8 – 1
- Degrees of Freedom =
**7**

**Explanation:** If the following values for the data set are selected randomly, 8, 25, 35, 17, 15, 22, 9, then the last value of the data set can be nothing other than = 20 * 8 – (8 + 25 + 35 + 17 + 15 + 22 + 9) = 29

- On the other hand, if the randomly selected values for the data set, -26, -1, 6, -4, 34, 3, 17, then the last value of the data set will be = 20 * 8 – (-26 + (-1) + 6 + (-4) + 34 + 2 + 17) = 132
- The above examples explain how the last value of the data set is constrained and as such the degree of freedom is sample size minus one.

#### Degrees of Freedom Formula – Example #2

**Let us take the example of a simple chi-square test (two-way table) with a 2×2 table with a respective sum for each row and column. Calculate its degree of freedom.**

**Solution:**

In the above, it can be seen that there is only one value in black which is independent and needs to be estimated. Once, that value is estimated then the remaining three values can be derived easily based on the constrains. Therefore,

Degrees of Freedom is calculated using the formula given below

**Degree of Freedom = (R – 1) * (C – 1)**

- Degree of Freedom = (2 – 1) * (2 – 1)
- Degree of Freedom =
**1**

#### Degrees of Freedom Formula – Example #3

**Let us take the example of a chi-square test (two-way table) with 5 rows and 4 columns with the respective sum for each row and column. Calculate the degree of freedom for the chi-square test table.**

**Solution:**

Degrees of Freedom is calculated using the formula given below

**Degree of Freedom = (R – 1) * (C – 1)**

- Degrees of Freedom = (5 – 1) * (4 – 1)
- Degrees of Freedom =
**12**

In this case, it can be seen that the values in black are independent and as such have to be estimated. However, the values in red are derived based on the estimated number and the constraint for each row and column. Therefore, the number of values in black is the equivalent to the degree of freedom i.e. = 12

### Explanation

The formula for Degrees of Freedom can be calculated by using the following steps:

**Step 1:** Firstly, define the constrain or condition to be satisfied by the data set, for eg: mean.

**Step 2:** Next, select the values of the data set conforming to the set condition. Now, you can select all the data except one, which should be calculated based on all the other selected data and the mean. Therefore, if the number of values in the data set is N, then the formula for the degree of freedom is as shown below.

**Degree of Freedom = N – 1**

The formula for Degrees of Freedom for the Two-Variable can be calculated by using the following steps:

**Step 1:** Once the condition is set for one row, then select all the data except one, which should be calculated abiding the condition. Therefore, if the number of values in the row is R, then the number of independent values in the row is (R – 1).

**Step 2:** Similarly, if the number of values in the column is C, then the number of independent values in the column is (C – 1).

**Step 3:** Finally, the formula for the degree of freedom can be derived by multiplying the number of independent values in row and column as shown below.

**Degree of Freedom = (R – 1) * (C – 1)**

### Relevance and Use of Degrees of Freedom Formula

The concept of degree of freedom is very important as it is used in various statistical applications such as defining the probability distributions for the test statistics of various hypothesis tests. For instance, the shape of the probability distribution for hypothesis testing using t-distribution, F-distribution, and chi-square distribution is determined by the degree of freedom.

### Recommended Articles

This is a guide to Degrees of Freedom Formula. Here we discuss how to calculate the Degrees of Freedom Formula along with practical examples. We also provide a downloadable excel template. You may also look at the following articles to learn more –