# Means Difference Confidence Interval Calculator

Calculates the confidence interval for the difference between two population means: **equal variances, unequal variances**, and **paired groups**.

The tool doesn't count empty cells or non-numeric cells.

### Confidence intervals for the difference between two population means

The means' difference confidence interval calculator computes the confidence interval for the difference between **two means**. The calculation uses the student's t distribution.

When using sample data, we know the sample's statistics, but we don't know the true value of the population parameters. Instead, we may treat the population parameters as random variables and calculate the confidence interval.

First, we need to define the **confidence level**, the required certainty level that the parameter's true value will be in the **confidence interval**. Researchers commonly use a confidence level of **0.95**.

The default is 95 confidence interval calculator, but you may change the confidence level.

This confidence interval calculator reports the results in APA style.

The online means' difference confidence interval calculator shows the formulas and step by step calculation.

### How to use the confidence interval calculator?

**Data is:***Average, SD , n*- enter the averages, the standard deviations, and the sample sizes (n).*Raw data*- enter the delimited data, separated by comma, 'space' or 'enter'. In this case the tool will calculate the averages, the standard deviations, and the sample sizes.

For*Matched samples (Paired)*test, you may use only the*raw data*option.**Type:***Equal variances*- assumed equal variances, equal standard deviations: σ_{1}= σ_{2}= σ.*Unequal variances*- assumed unequal variances, unequal standard deviations: σ_{1}≠ σ_{2}.*Matched samples (Paired)*- dependent groups, the same items in two different conditions or any others connection between the two samples when there is a one to one connection between the samples. Each value in one group is connected to one value in the other group.**Outliers:**- this option is relevant only when you enter*raw data*, using Tukey's fences method with k equal 1.5.

For '"Matched samples (Paired)', the outlier calculation done over the differences.**Included**- the calculator will calculate the outliers but will include them in the calculation.**Excluded**- The calculator will exclude the outliers before calculating the average and the standard deviation. You should remove outliers only if you identify them as invalid observations!**Confidence Level (CL)**- The certainty level that the true value of the estimated parameter will be in the confidence interval.**Rounding**- when the number is bigger than one the calculator rounds to the required decimal places, but when the number is smaller than one, it rounds to the required significant figures For example, when you choose 2, it will format 88.1234 to 88.12 , and 0.001234 to 0.0012.- Step by step - show the calculation steps

### What is a confidence interval?

The confidence interval is the range in which the population parameter is most likely to be found.

The degree of certainty for which it is likely to be within that range is called the confidence level.

When you collect sample data, you can not know the exact value of the parameter.

### What is a confidence level?

The confidence level is the required degree of certainty that the population parameter will be in the confidence interval. This is the probability that the calculated confidence interval contains the population parameter.

Note: researchers commonly use a confidence level of 0.95.

### What is a 95 confidence interval?

The 95% confidence interval is a proposition as follows, if one were to calculate the confidence interval for an infinite number of samples, then 95% of the calculated ranges will contain the population parameter.

#### What is the confidence interval formula for the difference between two means?

##### When you don't know the population's standard deviation

The standard deviation of the population is usually unknown, so you have to estimate it based on the sample data. The t-distribution will be used here.

CI = x̄_{1} - x̄_{2} ± T_{1 - α/2}(df) * SE

###### Equal standard deviations

Pooled variance formulaS_{p}^{2} = | (n_{1} - 1)S_{1}^{2} + (n_{2} - 1)S_{2}^{2} |

n_{1} + n_{2} - 2 |

_{x̄1 - x̄2})

SE = S_{p}√( | 1 | + | 1 | ) |

n_{1} | n_{2} |

df = n

_{1}+ n

_{2}- 2.

###### Unequal standard deviations

Standard error formulaSE = √( | S_{1}^{2} | + | S_{2}^{2} | ) |

n_{1} | n_{2} |

df = | ( | S_{1}^{2} | + | S_{2}^{2} | )^{2} |

n_{1} | n_{2} | ||||

S_{1}^{4} | + | S_{4}^{2} | |||

n_{1}^{2}(n_{1} - 1) | n_{2}^{2}(n_{2} - 1) |

###### Paired data

Difference confidence interval

CI = x̄_{d} ± T_{1 - α/2}(df) * SE

Standard error formula

SE = S_{x̄d =} | S_{d} |

√n |

Degrees of freedom formula

df = n_{1} + n_{2} - 2.

##### When you know the population's standard deviation

The normal distribution will be used here.

CI = x̄_{1} - x̄_{2} ± Z_{1 - α/2} * SE

Since you know the standard deviations it doesn't matter if the standard deviations are equal or not, in both cases we use the same formula

Calculate the variance of the difference between the two independent random variables:

SE = σ_{x̄₁ - x̄₂} = √(σ_{x̄₁}^{2} + σ_{x̄₂}^{2})

The standard deviation of the average is:

σ_{x̄}^{2 =} | σ^{2} |

n |

SE = σ_{x̄1 - x̄2} = √( | σ_{1}^{2} | + | σ_{2}^{2} | ) |

n_{1} | n_{2} |

Where:

x̄_{1} - the sample average of group_{1}.

x̄_{2} - the sample average of group_{2}.

x̄_{d} - for matched samples, the sample average of differences between the groups.

S_{1} - the sample standard deviation of group_{1}.

S_{2} - the sample standard deviation of group_{2}.

S_{d} - for matched samples, the sample standard deviation of differences between the groups.

n_{1} - the sample size of group_{1} (the number of observations).

n_{2} - the sample size of group_{2}.

CL -confidence level

α = 1 - CL.

T_{1 - α/2} - the t-score based on the t distribution, p(t < T_{1 - α/2}) = 1 - α/2.

df - degrees of freedom.