 TwoSampleZTest - Maple Help

Student[Statistics]

 TwoSampleZTest
 apply the two sample z-test for population means 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

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{Statistics}\right]\right):$

Specify the data sample.

 > $X≔\left[9,10,8,4,8,3,0,10,15,9\right]:$
 > $Y≔\left[6,3,10,11,9,8,13,4,4,4\right]:$
 > $\mathrm{Mean}\left(X\right)-\mathrm{Mean}\left(Y\right)$
 $\frac{{2}}{{5}}$ (1)

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

 > $\mathrm{TwoSampleZTest}\left(X,Y,4,4,3,\mathrm{confidence}=0.95\right)$
 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.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{confidenceinterval}}{=}{-2.69897516135683}{..}{3.49897516135683}{,}{\mathrm{distribution}}{=}{\mathrm{Normal}}{}\left({0}{,}{1}\right){,}{\mathrm{pvalue}}{=}{0.0227957869662967}{,}{\mathrm{statistic}}{=}{-2.27683991544247}\right]$ (2)

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

 > $\mathrm{TwoSampleZTest}\left(X,Y,4,4,3,\mathrm{confidence}=0.95,\mathrm{output}=\mathrm{plot}\right)$ If the output=both option is included, then both a report and a plot will be returned.

 > $\mathrm{report},\mathrm{graph}≔\mathrm{TwoSampleZTest}\left(X,Y,4,4,3,\mathrm{confidence}=0.95,\mathrm{output}=\mathrm{both}\right):$
 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
 > $\mathrm{report}$
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{confidenceinterval}}{=}{-2.69897516135683}{..}{3.49897516135683}{,}{\mathrm{distribution}}{=}{\mathrm{Normal}}{}\left({0}{,}{1}\right){,}{\mathrm{pvalue}}{=}{0.0227957869662967}{,}{\mathrm{statistic}}{=}{-2.27683991544247}\right]$ (3)
 > $\mathrm{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.