Statistics - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Tests : Statistics/TwoSampleFTest

Statistics

 TwoSampleFTest
 apply the two sample F-test for population variances

 Calling Sequence TwoSampleFTest(X1, X2, beta, options)

Parameters

 X1 - first data sample X2 - second data sample beta - realcons; the test value for the ratio of the two variances options - (optional) equation(s) of the form option=value where option is one of alternative, confidence, ignore, output, summarize, weights1 or weights2; specify options for the TwoSampleFTest function

Description

 • The TwoSampleFTest function computes the two sample F-test on datasets X1 and X2.  This calculation is used to determine the significance of the difference between the ratio of sample variances and an assumed ratio of population variances.
 • 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 ratio of population variances (assumed population variance of X1 divided by the assumed population variance of X2), specified as a real constant.

Options

 The options argument can contain one or more of the options shown below.
 • alternative='twotailed', 'lowertail', or 'uppertail'
 This option is used to specify the type or interval used in the analysis, or similarly, the alternative hypothesis to consider when performing the analysis.
 • 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.
 • ignore=truefalse
 This option is used to specify how to handle non-numeric data. If ignore is set to true all non-numeric items in data will be ignored.
 • output='report', 'statistic', 'pvalue', 'confidenceinterval', 'distribution', 'hypothesis', or list('statistic', 'pvalue', 'confidenceinterval', 'distribution', 'hypothesis')
 This option is used to specify the desired format of the output from the function.  If 'report' is specified then a module containing all output from this test is returned.  If a single parameter name is specified other than 'report' then that quantity alone is returned.  If a list of parameter names is specified then a list containing those quantities in the specified order will be returned.
 • summarize= 'true', 'false', 'embed'
 This option controls the display of a printed or embedded summary for the hypothesis test. Unlike the output option, the displayed summary is not assignable output.
 • weights1=rtable
 Vector of weights (one-dimensional rtable). If these weights are given, the TwoSampleFTest function will weight each data point in X1 accordingly. Note that the weights provided must have type realcons and the results are floating-point, even if the problem is specified with exact values. Both the data array and the weights array must have the same number of elements.
 • weights2=rtable
 Vector of weights (one-dimensional rtable).  This parameter is equivalent to the option weights1, except applying to data in X2.

Notes

 • This test generates a complete report of all calculations in the form of a userinfo message.  In order to access this report, specify infolevel[Statistics] := 1 or use the summarize option.
 • The chi-square test should be used to compare the variance (or standard deviation) of one sample against an assumed population variance (or standard deviation).

Examples

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

Specify the data sample.

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

Calculate the two sample F-test on an array of values, assuming equal variances.

 > $\mathrm{TwoSampleFTest}\left(X,Y,1,\mathrm{confidence}=0.95,\mathrm{summarize}=\mathrm{embed}\right):$

Null Hypothesis:

Sample drawn from populations with ratio of variances equal to 1

Alternative Hypothesis:

Sample drawn from population with ratio of variances not equal to 1

 Sample Size Sample Variance Ratio of Variances Sample 1 ${10.}$ ${18.0444}$ ${1.48175}$ Sample 2 ${10.}$ ${12.1778}$

 Distribution Computed Statistic Computed p-value Confidence Interval ${\mathrm{FRatio}}{}\left({9}{,}{9}\right)$ ${1.48175}$ ${0.567368}$ ${0.368046}{..}{5.96552}$

Result:

Accepted: This statistical test does not provide enough evidence to conclude that the null hypothesis is false.

Calculate the lower tail F-test.

 > $\mathrm{TwoSampleFTest}\left(X,Y,1,\mathrm{confidence}=0.95,\mathrm{alternative}='\mathrm{lowertail}',\mathrm{summarize}=\mathrm{true}\right)$
 F-Ratio Test on Two Samples --------------------------- Null Hypothesis: Sample drawn from populations with ratio of variances greater than 1 Alt. Hypothesis: Sample drawn from population with ratio of variances less than 1   Sample Sizes:            10, 10 Sample Variances:        18.0444, 12.1778 Ratio of Variances:      1.48175 Distribution:            FRatio(9,9) Computed Statistic:      1.48175182481752 Computed p-value:        .716316036709511 Confidence Interval:     0 .. 4.71033065843087                          (ratio of population variances)   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 ${\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{0}{..}{4.71033065843087}{,}{\mathrm{distribution}}{=}{\mathrm{FRatio}}{}\left({9}{,}{9}\right){,}{\mathrm{pvalue}}{=}{0.716316036709511}{,}{\mathrm{statistic}}{=}{1.48175182481752}$ (2)

As an alternative to using the summarize option, setting infolevel[Statistics] := 1 also returns the printed summary.

 > ${\mathrm{infolevel}}_{\mathrm{Statistics}}≔1:$

Calculate the upper tail F-test.

 > $\mathrm{TwoSampleFTest}\left(X,Y,1,\mathrm{confidence}=0.95,\mathrm{alternative}='\mathrm{uppertail}'\right)$
 F-Ratio Test on Two Samples --------------------------- Null Hypothesis: Sample drawn from populations with ratio of variances less than 1 Alt. Hypothesis: Sample drawn from population with ratio of variances greater than 1   Sample Sizes:            10, 10 Sample Variances:        18.0444, 12.1778 Ratio of Variances:      1.48175 Distribution:            FRatio(9,9) Computed Statistic:      1.48175182481752 Computed p-value:        .283683963290489 Confidence Interval:     .4661219412315 .. infinity                          (ratio of population variances)   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 ${\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{confidenceinterval}}{=}{0.466121941231500}{..}{\mathrm{∞}}{,}{\mathrm{distribution}}{=}{\mathrm{FRatio}}{}\left({9}{,}{9}\right){,}{\mathrm{pvalue}}{=}{0.283683963290489}{,}{\mathrm{statistic}}{=}{1.48175182481752}$ (3)
 > 

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 Statistics[TwoSampleFTest] command was updated in Maple 2016.
 • The summarize option was introduced in Maple 2016.