Function Repository Resource:

MeanDifferenceCI

Source Notebook

Estimate the confidence interval of the difference between the population means

Contributed by: Wolfram Research

ResourceFunction["MeanDifferenceCI"][list1,list2]

gives a confidence interval for the difference between the population means estimated from list1 and list2.

Details and Options

ResourceFunction["MeanDifferenceCI"][list1,list2] gives a confidence interval {min,max} centered at Mean[list1]-Mean[list2].
ResourceFunction["MeanDifferenceCI"] is based on a normal distribution if the population variances are assumed known.
If the variances for the two populations are assumed equal and unknown, the interval is based on a Student's t-distribution with (Length[list1]+Length[list2]-2) degrees of freedom.
If the population variances are not assumed known and not assumed equal, Welch's approximation for the degrees of freedom is used.
The following options can be given:
ConfidenceLevel0.95probability associated with a confidence interval
EqualVariancesFalsewhether the unknown population variances are assumed equal
KnownVarianceNonelist of variances of each population

Examples

Basic Examples (1) 

The 95% confidence interval for the difference in two population means:

In[1]:=
ResourceFunction[
 "MeanDifferenceCI"][{1, 2, 4, 6, 3}, {4, 10, 6, 8, 5, 8}]
Out[1]=

Options (3) 

ConfidenceLevel (1) 

The 99% confidence interval:

In[2]:=
ResourceFunction[
 "MeanDifferenceCI"][{1, 2, 4, 6, 3}, {4, 10, 6, 8, 5, 8}, ConfidenceLevel -> .99]
Out[2]=

EqualVariances (1) 

A confidence interval assuming equal but unknown variances:

In[3]:=
ResourceFunction[
 "MeanDifferenceCI"][{1, 2, 4, 6, 3}, {4, 10, 6, 8, 5, 8}, "EqualVariances" -> True]
Out[3]=

KnownVariance (1) 

A confidence interval assuming known variances:

In[4]:=
ResourceFunction[
 "MeanDifferenceCI"][{1, 2, 4, 6, 3}, {4, 10, 6, 8, 5, 8}, "KnownVariance" -> {1, 2}]
Out[4]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 13 February 2019

Related Resources

License Information