OneSampleTTest - Maple Help

Student[Statistics]

 OneSampleTTest
 apply the one sample t-test for the population mean of a sample

 Calling Sequence OneSampleTTest(X, mu0, confidence_option, output_option)

Parameters

 X - mu0 - realcons; the test value for the mean 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 OneSampleTTest function computes the one sample t-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. No assumptions are made on the standard deviation.
 • 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.
 • 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 stronger version of the t-test, the z-test is available if the standard deviation of the sample is 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 t-test on a list of values.

 > $\mathrm{OneSampleTTest}\left(X,4,\mathrm{confidence}=0.95\right)$
 Standard T-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 4 Alt. Hypothesis: Sample drawn from population with mean not equal to 4   Sample Size:             10 Sample Mean:             7.6 Sample Standard Dev.:    4.24788 Distribution:            StudentT(9) Computed Statistic:      2.67997500172151 Computed p-value:        .0252070995508197 Confidence Interval:     4.56125385050882 .. 10.6387461494912                          (population mean)   Result: [Rejected] This statistical test provides evidence that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{confidenceinterval}}{=}{4.56125385050882}{..}{10.6387461494912}{,}{\mathrm{distribution}}{=}{\mathrm{StudentT}}{}\left({9}\right){,}{\mathrm{pvalue}}{=}{0.0252070995508197}{,}{\mathrm{statistic}}{=}{2.67997500172151}\right]$ (2)

Try another data sample.

 > $Y≔\mathrm{Sample}\left(\mathrm{ExponentialRandomVariable}\left(10\right),1000\right):$
 > $\mathrm{Mean}\left(Y\right)$
 ${9.53689919348922}$ (3)
 > $\mathrm{OneSampleTTest}\left(Y,10\right)$
 Standard T-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 10 Alt. Hypothesis: Sample drawn from population with mean not equal to 10   Sample Size:             1000 Sample Mean:             9.5369 Sample Standard Dev.:    9.47321 Distribution:            StudentT(999) Computed Statistic:      -1.54588971684565 Computed p-value:        .122447910297306 Confidence Interval:     8.94904230861746 .. 10.124756078361                          (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}}{=}{8.94904230861746}{..}{10.1247560783610}{,}{\mathrm{distribution}}{=}{\mathrm{StudentT}}{}\left({999}\right){,}{\mathrm{pvalue}}{=}{0.122447910297306}{,}{\mathrm{statistic}}{=}{-1.54588971684565}\right]$ (4)

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

 > $\mathrm{OneSampleTTest}\left(Y,10,\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{OneSampleTTest}\left(Y,10,\mathrm{output}=\mathrm{both}\right):$
 Standard T-Test on One Sample ----------------------------- Null Hypothesis: Sample drawn from population with mean 10 Alt. Hypothesis: Sample drawn from population with mean not equal to 10   Sample Size:             1000 Sample Mean:             9.5369 Sample Standard Dev.:    9.47321 Distribution:            StudentT(999) Computed Statistic:      -1.54588971684565 Computed p-value:        .122447910297306 Confidence Interval:     8.94904230861746 .. 10.124756078361                          (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:      .00285645221288875 .. 67.755043620294 Bin Width:       2.25840623893604 Number of Bins:  30 Frequency Scale: relative
 > $\mathrm{report}$
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{8.94904230861746}{..}{10.1247560783610}{,}{\mathrm{distribution}}{=}{\mathrm{StudentT}}{}\left({999}\right){,}{\mathrm{pvalue}}{=}{0.122447910297306}{,}{\mathrm{statistic}}{=}{-1.54588971684565}\right]$ (5)
 > $\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][OneSampleTTest] command was introduced in Maple 18.