TwoSampleZTest - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[Statistics]

  

TwoSampleZTest

  

apply the two sample z-test for population means

 

Calling Sequence

Parameters

Description

Notes

Examples

References

Compatibility

Calling Sequence

TwoSampleZTest(X1, X2, beta, sigma1, sigma2, confidence_option, output_option)

Parameters

X1

-

first data sample

X2

-

second data sample

beta

-

realcons; the test value for the difference between the two means

sigma1

-

realcons; the known standard deviation of the population of X1

sigma2

-

realcons; the known standard deviation of the population of X2

confidence_option

-

(optional) equation of the form confidence=float.

output_option

-

(optional) equation of the form output=x where x is report, plot, or both

Description

• 

The TwoSampleZTest function computes the two sample z-test upon data samples X1 and X2. This tests whether the population mean of X1 minus the population mean of X2 is equal to beta, under the assumption that both populations are normally distributed, with respective standard deviations sigma1 and sigma2.

• 

The first parameter X1 is the first data sample to use in the analysis.

• 

The second parameter X2 is the second data sample to use in the analysis.

• 

The third parameter beta is the assumed difference in population means (assumed population mean of X1 minus the assumed population mean of X2), specified as a real constant.

• 

The fourth parameter sigma1 is the known standard deviation of the sample X1.

• 

The fifth parameter sigma2 is the known standard deviation of the sample X2.

• 

confidence=float

  

This option is used to specify the confidence level of the interval and must be a floating-point value between 0 and 1.  By default this is set to 0.95.

• 

If the option output is not included or is specified to be output=report, then the function will return a report. If output=plot is specified, then the function will return a plot of the sample test. If output=both is specified, then both the report and the plot will be returned.

Notes

• 

A weaker version of the z-test, the t-test is available if the standard deviation of the sample is unknown.

Examples

withStudentStatistics:

Specify the data sample.

X9,10,8,4,8,3,0,10,15,9:

Y6,3,10,11,9,8,13,4,4,4:

MeanXMeanY

25

(1)

Calculate the two sample z-test on a list of values, assuming a difference in means of 4.

TwoSampleZTestX,Y,4,4,3,confidence=0.95

Standard Z-Test on Two Samples
------------------------------
Null Hypothesis:
Sample drawn from populations with difference of means equal to 4
Alt. Hypothesis:
Sample drawn from population with difference of means not equal to 4
 
Sample Sizes:            10, 10
Sample Means:            7.6, 7.2
Difference in Means:     0.4
Distribution:            Normal(0,1)
Computed Statistic:      -2.27683991544247
Computed p-value:        .0227957869662967
Confidence Interval:     -2.69897516135683 .. 3.49897516135683
                         (difference of population means)
 
Result: [Rejected]
This statistical test provides evidence that the null hypothesis is false.

hypothesis=false,confidenceinterval=−2.69897516135683..3.49897516135683,distribution=Normal0,1,pvalue=0.0227957869662967,statistic=−2.27683991544247

(2)

If the output=plot option is included, then a plot will be returned.

TwoSampleZTestX,Y,4,4,3,confidence=0.95,output=plot

If the output=both option is included, then both a report and a plot will be returned.

report,graphTwoSampleZTestX,Y,4,4,3,confidence=0.95,output=both:

Standard Z-Test on Two Samples
------------------------------
Null Hypothesis:
Sample drawn from populations with difference of means equal to 4
Alt. Hypothesis:
Sample drawn from population with difference of means not equal to 4
 
Sample Sizes:            10, 10
Sample Means:            7.6, 7.2
Difference in Means:     0.4
Distribution:            Normal(0,1)
Computed Statistic:      -2.27683991544247
Computed p-value:        .0227957869662967
Confidence Interval:     -2.69897516135683 .. 3.49897516135683
                         (difference of population means)
 
Result: [Rejected]
This statistical test provides evidence that the null hypothesis is false.
Histogram Type:  default
Data Range:      0 .. 15
Bin Width:       1/2
Number of Bins:  30
Frequency Scale: relative
Histogram Type:  default
Data Range:      3 .. 13
Bin Width:       1/3
Number of Bins:  30
Frequency Scale: relative

report

hypothesis=false,confidenceinterval=−2.69897516135683..3.49897516135683,distribution=Normal0,1,pvalue=0.0227957869662967,statistic=−2.27683991544247

(3)

graph

References

  

Kanji, Gopal K. 100 Statistical Tests. London: SAGE Publications Ltd., 1994.

  

Sheskin, David J. Handbook of Parametric and Nonparametric Statistical Procedures. London: CRC Press, 1997.

Compatibility

• 

The Student[Statistics][TwoSampleZTest] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Statistics[TwoSampleZTest]

Student

Student/Statistics/TwoSampleZTest/overview

Student[Statistics]

Student[Statistics][HypothesisTest]

Student[Statistics][OneSampleZTest]