Click or drag to resize
NormTwoSample Class
Computes statistics for mean and variance inferences using samples from two normal populations.
Inheritance Hierarchy
SystemObject
  Imsl.StatNormTwoSample

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class NormTwoSample

The NormTwoSample type exposes the following members.

Constructors
  NameDescription
Public methodNormTwoSample
Constructor to compute statistics for mean and variance inferences using samples from two normal populations.
Top
Methods
  NameDescription
Public methodDowndateX
Removes the observations in x from the first sample.
Public methodDowndateY
Removes the observations in y from the second sample.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Concatenates samples x and y to the samples provided in the constructor.
Public methodUpdateX
Concatenates the values in x to the first sample provided in the constructor.
Public methodUpdateY
Concatenates the values in y to the second sample provided in the constructor.
Top
Properties
  NameDescription
Public propertyChiSquaredTest
The test statistic associated with the chi-squared test for common, or pooled, variances.
Public propertyChiSquaredTestDF
The degrees of freedom associated with the chi-squared test for the common, or pooled, variances.
Public propertyChiSquaredTestNull
The null hypothesis value for the chi-squared test.
Public propertyChiSquaredTestP
The probability of a larger chi-squared associated with the chi-squared test for common, or pooled, variances.
Public propertyConfidenceMean
The confidence level (in percent) for a two-sided interval estimate of the mean of x - the mean of y, in percent.
Public propertyConfidenceVariance
The confidence level (in percent) for two-sided interval estimate of the variances.
Public propertyDiffMean
The difference of means for the two samples.
Public propertyFTest
The F test value of the F test for equality of variances.
Public propertyFTestDFdenominator
The denominator degrees of freedom of the F test for equality of variances.
Public propertyFTestDFnumerator
The numerator degrees of freedom of the F test for equality of variances.
Public propertyFTestP
The probability of a larger F in absolute value for the F test for equality of variances, assuming equal variances.
Public propertyLowerCICommonVariance
The lower confidence limits for the common, or pooled, variance.
Public propertyLowerCIDiff
The lower confidence limit for the mean of the first population minus the mean of the second for equal or unequal variances.
Public propertyLowerCIRatioVariance
The approximate lower confidence limit for the ratio of the variance of the first population to the second.
Public propertyMeanX
The mean of the first sample, x.
Public propertyMeanY
The mean of the second sample, y.
Public propertyPooledVariance
The Pooled variance for the two samples.
Public propertyStdDevX
The standard deviation of the first sample, x.
Public propertyStdDevY
The standard deviation of the second sample, y.
Public propertyTTest
The test statistic for the Satterthwaite's approximation for equal or unequal variances.
Public propertyTTestDF
The degrees of freedom for the Satterthwaite's approximation for t-test for either equal or unequal variances.
Public propertyTTestNull
The Null hypothesis value for t-test for the mean.
Public propertyTTestP
The approximate probability of a larger t for the Satterthwaite's approximation for equal or unequal variances.
Public propertyUnequalVariances
Specifies whether to return statistics based on equal or unequal variances.
Public propertyUpperCICommonVariance
The upper confidence limits for the common, or pooled, variance.
Public propertyUpperCIDiff
The upper confidence limit for the mean of the first population minus the mean of the second for equal or unequal variances.
Public propertyUpperCIRatioVariance
The approximate upper confidence limit for the ratio of the variance of the first population to the second.
Top
Remarks

Class NormTwoSample computes statistics for making inferences about the means and variances of two normal populations, using independent samples in x1 and x2. For inferences concerning parameters of a single normal population, see class NormOneSample.

Let \mu_1 and \sigma _1^2 be the mean and variance of the first population, and let \mu_2 and \sigma _2^2 be the corresponding quantities of the second population. The function contains test confidence intervals for difference in means, equality of variances, and the pooled variance.

The means and variances for the two samples are as follows:

\bar x_1  = \left( {\sum {x_{1i} /n_1 } } 
            \right), \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \bar x_2  = \left( 
            {\sum {x_{2i} } } \right)/n_2

and

s_1^2  = \sum {\left( {x_{1i}  - \bar x_1 } 
            \right)} ^2 /\left( {n_1  - 1} \right), \,\,\,\,\,\,\,\,\,\,\,s_2^2  = 
            \sum {\left( {x_{2i}  - {\bar x}_2} \right)} ^2 /\left( {n_2  - 1} 
            \right)

Inferences about the Means

The test that the difference in means equals a certain value, for example, \mu_0, depends on whether or not the variances of the two populations can be considered equal. If the variances are equal and meanHypothesis equals 0, the test is the two-sample t-test, which is equivalent to an analysis-of-variance test. The pooled variance for the difference-in-means test is as follows:

s^2  = \frac{{\left( {n_1  - 1} \right)s_1  + 
            \left( {n_2  - 1} \right)s_2 }} {{n_1  + n_2  - 2}}

The t statistic is as follows:

t = \frac{{\bar x_1  - \bar x_2  - \mu _0 }} 
            {s\sqrt {{\left( {1/n_1 } \right)} + \left( {1/n_2 } \right)}}

Also, the confidence interval for the difference in means can be obtained by first assigning the unequal variances flag to false. This can be done by setting the UnequalVariances property. The confidence interval can then be obtained by the LowerCIDiff and UpperCIDiff properties.

If the population variances are not equal, the ordinary t statistic does not have a t distribution and several approximate tests for the equality of means have been proposed. (See, for example, Anderson and Bancroft 1952, and Kendall and Stuart 1979.) One of the earliest tests devised for this situation is the Fisher-Behrens test, based on Fisher's concept of fiducial probability. A procedure used in the TTest, LowerCIDiff and UpperCIDiff properties assuming unequal variances are specified is the Satterthwaite's procedure, as suggested by H.F. Smith and modified by F.E. Satterthwaite (Anderson and Bancroft 1952, p. 83). Set UnequalVariances true to obtain results assuming unequal variances.

The test statistic is

t' = \left( {\bar x_1  - \bar x_2  - \mu _0 } 
            \right)/s_d

where

s_d  = \sqrt {\left( {s_1^2 /n_1 } \right) + 
            \left( {s_2^2 /n_2 } \right)}

Under the null hypothesis of \mu_1- \mu_2= c, this quantity has an approximate t distribution with degrees of freedom df, given by the following equation:

{\rm{df}} = \frac{{s_d^4 }}{{\frac{{\left( 
            {s_1^2 /n_1 } \right)^2 }}{{n_1  - 1}} + \frac{{\left( {s_2^2 /n_2 } 
            \right)^2 }}{{n_2  - 1}}}}

Inferences about Variances

The F statistic for testing the equality of variances is given by F = s_{\max }^2 /s_{\min }^2, where s_{\max}^2 is the larger of s_1^2 and s_2^2. If the variances are equal, this quantity has an F distribution with n_1 - 1 and n_2 - 1 degrees of freedom.

It is generally not recommended that the results of the F test be used to decide whether to use the regular t-test or the modified t' on a single set of data. The modified t' (Satterthwaite's procedure) is the more conservative approach to use if there is doubt about the equality of the variances.

See Also

Reference

Other Resources