Student[Statistics] - Maple Help

Home : Support : Online Help : Education : Student Package : Statistics : Hypothesis Tests : Student/Statistics/OneSampleZTest

Student[Statistics]

 OneSampleZTest
 apply the one sample z-test for the population mean of a sample

 Calling Sequence OneSampleZTest(X, mu0, sigma, confidence_option, output_option)

Parameters

 X - mu0 - realcons; the test value for the mean sigma - realcons; the standard deviation of the sample X was drawn from 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 OneSampleZTest function computes the one sample z-test upon a data sample X. This tests whether the mean of the population is equal to mu0, under the assumption that the population is normally distributed with standard deviation sigma.
 • The first parameter X is the data sample to use in the analysis.
 • The second parameter mu0 is the assumed population mean, specified as a real constant.
 • The third parameter sigma is the known population standard deviation, specified as a positive real constant.
 • 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 not known.

Examples

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

Specify the data sample.

 > $X≔\left[9,10,8,4,8,3,0,10,15,9\right]:$
 > $\mathrm{Mean}\left(X\right)$
 $\frac{{38}}{{5}}$ (1)

Calculate the one sample z-test on a list of values.

 > $\mathrm{OneSampleZTest}\left(X,5,5,\mathrm{confidence}=0.95\right)$
 Standard Z-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 5 and known standard deviation 5 Alt. Hypothesis: Sample drawn from population with mean not equal to 5 and known standard deviation 5   Sample Size:             10 Sample Mean:             7.6 Distribution:            Normal(0,1) Computed Statistic:      1.64438438337511 Computed p-value:        .100096828833158 Confidence Interval:     4.50102483864317 .. 10.6989751613568                          (population mean)   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{4.50102483864317}{..}{10.6989751613568}{,}{\mathrm{distribution}}{=}{\mathrm{Normal}}{}\left({0}{,}{1}\right){,}{\mathrm{pvalue}}{=}{0.100096828833158}{,}{\mathrm{statistic}}{=}{1.64438438337511}\right]$ (2)

Try another data sample.

 > $Y≔\mathrm{Sample}\left(\mathrm{NormalRandomVariable}\left(10,15\right),1000\right):$
 > $\mathrm{OneSampleZTest}\left(Y,11,15\right)$
 Standard Z-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 11 and known standard deviation 15 Alt. Hypothesis: Sample drawn from population with mean not equal to 11 and known standard deviation 15   Sample Size:             1000 Sample Mean:             10.9169 Distribution:            Normal(0,1) Computed Statistic:      -.175176935595206 Computed p-value:        .86094060682115 Confidence Interval:     9.98721373509595 .. 11.8465988319101                          (population mean)   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{9.98721373509595}{..}{11.8465988319101}{,}{\mathrm{distribution}}{=}{\mathrm{Normal}}{}\left({0}{,}{1}\right){,}{\mathrm{pvalue}}{=}{0.860940606821150}{,}{\mathrm{statistic}}{=}{-}{0.175176935595206}\right]$ (3)

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

 > $\mathrm{OneSampleZTest}\left(Y,11,15,\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{OneSampleZTest}\left(Y,11,15,\mathrm{output}=\mathrm{both}\right):$
 Standard Z-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 11 and known standard deviation 15 Alt. Hypothesis: Sample drawn from population with mean not equal to 11 and known standard deviation 15   Sample Size:             1000 Sample Mean:             10.9169 Distribution:            Normal(0,1) Computed Statistic:      -.175176935595206 Computed p-value:        .86094060682115 Confidence Interval:     9.98721373509595 .. 11.8465988319101                          (population mean)   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false. Histogram Type:  default Data Range:      -30.7094021886569 .. 54.4808425292522 Bin Width:       2.8396748239303 Number of Bins:  30 Frequency Scale: relative
 > $\mathrm{report}$
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{9.98721373509595}{..}{11.8465988319101}{,}{\mathrm{distribution}}{=}{\mathrm{Normal}}{}\left({0}{,}{1}\right){,}{\mathrm{pvalue}}{=}{0.860940606821150}{,}{\mathrm{statistic}}{=}{-}{0.175176935595206}\right]$ (4)
 > $\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][OneSampleZTest] command was introduced in Maple 18.