Skip to main content

StatsFTest

StatsFTest [/ALPH=significance /TAIL=tc /T=km /Q/Z] wave1, wave2

The StatsFTest operation performs the F-test on the two distributions in wave1 and wave2, which can be any real numeric type, must contain at least two data points each, and can have an arbitrary number of dimensions. Output is to the W_StatsFTest wave in the current data folder or optionally to a table.

Flags

/ALPH=valSets the significance level (default val =0.05).
/TAIL=tcSpecifies the tail tested.
tc =1:Lower one-tail test with H<sub>a</sub>: sigma1>sigma2.
tc =2:Upper one-tail test with H<sub>a</sub>: sigma1<sigma2.
tc =4:Default; the null hypothesis H<sub>0</sub>: sigma1=sigma2 with H<sub>a</sub>: sigma1!=sigma2.
/QNo results printed in the history area.
/T=kDisplays results in a table. k specifies the table behavior when it is closed.
k =0:Normal with dialog (default).
k =1:Kills with no dialog.
k =2:Disables killing.
/ZIgnores errors. V_flag will be set to -1 for any error and to zero otherwise.

Details

The F statistic is the ratio of the variance of wave1 to the variance of wave2. We assume the waves have equal wave variances and that H0 is sigma1=sigma2. For the upper one-tail test we reject H0 if F is greater than the upper critical value or if F is smaller than the lower critical value in the lower one-tail test. In the two-tailed test we reject H0 if F is either greater than the upper critical value or smaller than the lower critical value. The critical values are computed by numerically solving for the argument at which the cumulative distribution function (CDF) equals the appropriate values for the tests. The CDF is given by

F(x,n1,n2)=1betai(n22,n12,n2n2+n1x),\displaystyle F\left(x, n_{1}, n_{2}\right)=1-{betai}\left(\frac{n_{2}}{2}, \frac{n_{1}}{2}, \frac{n_{2}}{n_{2}+n_{1} x}\right),

where the degrees of freedom n1 and n2 equal the number of valid (non-NaN) points in each wave -1, and betai is the incomplete beta function. To get the critical value for the upper one-tail test we solve F(x)=1-alpha. For the lower one-tail test we solve F(x)=alpha. In the two-tailed test the lower critical value is a solution for F(x)=alpha/2 and the upper critical value is a solution for F(x)=1-alpha/2.

See Also

Statistical Analysis, StatsVariancesTest, StatsFCDF, betai

Demos

Open F-Test Demo.pxp