# Sample Variance Calculator

Sample variance is the measure of variation seen in the *sample* data in a *single* sample. In calculating terms it can be explained as the average of the squared differences from the Mean.
As the definition states, we have 3 steps to calculate it.

**Step 1: **Calculate the mean of the sample data.

**Step 2: **Subtract the mean from the original value for each sample data and square the result.

**Step 3: **Add all the output from step 2 and divide it with N-1.

## Sample Variance Calculation

Code to add this calci to your website

### Example

#### Sample Variance

Lets consider x value 4,8,2,9.

Find the mean value to get sample varians σ^{2}

μ = (4 + 8 + 2 + 9) / 4

μ = 5.75

Find th sum of difference of sample data to the mean and square the obtained value (x - μ)^{2}

4 = 3.0625

8 = 5.0625

2 = 14.0625

9 = 10.5625

∑(x - μ)^{2} = 3.0625 + 5.0625 + 14.0625 + 10.5625

∑(x - μ)^{2} = 32.75

Then, dividing by the total value which is subtracted by 1 (N-1)

σ^{2} = 32.75 / (4 - 1)

σ^{2} = 10.9167