If the sample size is large, use Z Scores from the Standard Normal Distribution.
Return the upper confidence bound of a one-tailed confidence interval.
Return the lower confidence bound of a one-tailed confidence interval.
Return both bounds of a two-tailed confidence interval.
Otherwise, calculate the degrees of freedom and use Student's t distribution.
Return the upper confidence bound of a one-tailed confidence interval.
Return the lower confidence bound of a one-tailed confidence interval.
Return both bounds of a two-tailed confidence interval.
CI on the Difference between Two Means
The Confidence Interval on the Difference between Two Means uses the sample means and sample standard deviations of the two sampled distributions as estimates of the population parameters. When the number of observations
n_x
orn_y
are small (≤ 30), the Student's t Distribution is used; when large, Z Scores from the Standard Normal Distribution are used.mctad.confidenceIntervalOnTheDifferenceBetweenTwoMeans()
returns an Array of lower, upper values for the(1 - α/2)
interval or a Number for the lower or upper(1 - α)
boundary.Assumptions
Given samples from two distributions,
x_bar
andy_bar
are the sample means,s_x
ands_y
are the sample standard deviations,n_x
andn_y
are the number of observations, and 0.0 <α
< 1.0. By default, the confidence interval is two-tailed; this may be changed by specifyingtype
as either 'l' for lower, or 'u' for upper. Any other value fortype
generates a two-tailed confidence interval.Use
mctad.confidenceIntervalOnTheDifferenceBetweenTwoMeans(x_bar, s_x, y_bar, s_y, n_x, n_y, α, 'u')
Inline Comments