Dataplot Vol 1 Vol 2

# KLOTZ TEST

Name:
KLOTZ TEST
Type:
Analysis Command
Purpose:
Perform a Klotz test that k samples have equal variances.
Description:
The F test is the standard parameteric test for testing the equality of variances for the two sample case.

A Klotz test is a non-parametric alternative to the F test. It is based on the squares of normal scores. Normal scores are computed as

$$A_{i} = \Phi^{-1} \left( \frac{R_i}{N+1} \right)$$

where Ri is the rank of the i-th observation, N is the sample size, and $$\Phi^{-1}$$ is the percent point function of the standard normal distribution.

The advantage of many tests based on normal scores is that they perform well when the assumptions of the standard parametric test are satisfied while still providing protection when the assumptions are not satisfied.

The Klotz test is defined as

 H0: The two populations have equal variances Ha: The two populations do not have equal variances Test Statistic: To compute the test statistic, for each sample first subtract the mean from each observation. Then compute the normal scores (Ai) for the combined sample. The test statistic is then T1 = NUM/DEN where $$\mbox{NUM} = \sum_{i=1}^{n_1}{A_{i}^2} - \left( \frac{n1}{n1+n2}\right) \sum_{i=1}^{n1+n2}{A_{i}^2}$$ $$\mbox{DEN} = \sqrt{C \left( \sum_{i=1}^{n1+n2}{A_{i}^4} - \frac{1}{n1+n2} \left( \sum_{i=1}^{n1+n2}{A_{i}^2} \right) ^2 \right) }$$ n1 = sample size 1 n2 = sample size 2 C = (n1*n2)/ ((n1+n2)* (n1+n2-1)) Significance Level: $$\alpha$$ Critical Region: For a two-tailed test: $$\mbox{T1} > \Phi^{-1}(1 - (\alpha/2))$$ $$\mbox{T1} < \Phi^{-1}(\alpha/2)$$ For a lower-tailed test: $$\mbox{T1} < \Phi^{-1}(\alpha)$$ For an upper-tailed test: $$\mbox{T1} > \Phi^{-1}(1 - \alpha)$$ $$\Phi^{-1}$$ is the percent point function of the standard normal distribution Conclusion: Reject the null hypothesis if the test statistic is in the critical region.

The critical values based on the normal test are only approximate. Dataplot does not currently compute exact critical values.

Syntax 1:
<LOWER TAILED/UPPER TAILED> KLOTZ TEST <y1> <y2>
<SUBSET/EXCEPT/FOR qualification>
where <LOWER TAILED/UPPER TAILED> is an optional keyword for the two sample case;
<y1> is the first response variable;
<y2> is the second variable;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

The LOWER TAILED and UPPER TAILED keywords are optional Only one can be specified and if neither is entered a two-tailed test will be performed.

Syntax 2:
<LOWER TAILED/UPPER TAILED> KLOTZ TEST <y1> ... <yk>
<SUBSET/EXCEPT/FOR qualification>
where <LOWER TAILED/UPPER TAILED> is an optional keyword for the two sample case;
<y1> ... <yk> is a list of 2 to 30 response variables;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

The LOWER TAILED and UPPER TAILED keywords are optional Only one can be specified and if neither is entered a two-tailed test will be performed.

This syntax will generate all the pairwise Klotz tests for the list of variables.

Examples:
KLOTZ TEST Y1 Y2
LOWER TAILED KLOTZ TEST Y1 Y2
UPPER TAILED KLOTZ TEST Y1 Y2
KLOTZ TEST Y1 TO Y10
Note:
The Klotz test accepts matrix arguments. A matrix will act like a variable in that all the values in the matrix will be converted to a single variable. That is, it does not act on the rows or colums independently.

The TO syntax is supported for this command.

Note:
The squared ranks test is an alternative non-parametric test for comparing the variances of k populations.
Note:
The following statistics are also supported:

LET A = KLOTZ TEST Y1 Y2
LET A = KLOTZ TEST CDF Y1 Y2
LET A = KLOTZ TEST PVALUE Y1 Y2
LET A = KLOTZ TEST LOWER TAILED PVALUE Y1 Y2
LET A = KLOTZ TEST UPPER TAILED PVALUE Y1 Y2

Enter HELP STATISTICS to see what commands can use these statistics.

Default:
None
Synonyms:
None
Related Commands:
 SQUARED RANKS TEST = Perform k sample squared ranks test for equal variances. F TEST = Perform k sample F-test for equal variances. KRUSKAL WALLIS TEST = Perform Kruskal Wallis test for equal locations. VAN DER WAERDEN TEST = Perform Van Der Waerden test for equal locations.
Reference:
W. J. Conover (1999), "Practical Nonparameteric Statistics," Third Edition, Wiley, pp. 401-402.
Applications:
Nonparametric Analysis
Implementation Date:
2011/5
Program:

. Step 1: Read Data (from p. 402 of Conover)
.
let y1 = data 10.8 11.1 10.4 10.1 11.3
let y2 = data 10.8 10.5 11.0 10.9 10.8 10.7 10.8
set write decimals 4
.
.  Step 2: Check the statistic
.
let stat  = klotz test y1 y2
let cdf   = klotz test cdf y1 y2
let pval  = klotz test pvalue y1 y2
print stat pval cdf
.
.  Step 3: Perform Klotz test
.
klotz test y1 y2

The following output is generated.
PARAMETERS AND CONSTANTS--

STAT    --         2.3447
PVAL    --         0.0190
CDF     --         0.9905

Two Sample Two-Sided Klotz Test

First Response Variable: Y1
Second Response Variable: Y2

H0: Var(Y1) = Var(Y2)
Ha: Var(Y1) <> Var(Y2)

Summary Statistics:
Number of Observations for Sample 1:                  5
Mean for Sample 1:                              10.7400
Variance for Sample                              0.2430
Number of Observations for Sample 2:                  7
Mean for Sample 2:                              10.7857
Variance for Sample                              0.0247

Test (Normal Approximation):
Test Statistic Value:                            2.3447
CDF Value:                                       0.9904
P-Value (2-tailed test):                         0.0190
P-Value (lower-tailed test):                     0.9904
P-Value (upper-tailed test):                     0.0095

Two-Tailed Test: Normal Approximation

H0: Var(Y1) = Var(Y2); Ha: Var(Y1) <> Var(Y2)
------------------------------------------------------------
Null
Significance           Test       Critical     Hypothesis
Level      Statistic    Value (+/-)     Conclusion
------------------------------------------------------------
80.0%         2.3447         1.2815         REJECT
90.0%         2.3447         1.6448         REJECT
95.0%         2.3447         1.9599         REJECT
99.0%         2.3447         2.5758         ACCEPT


NIST is an agency of the U.S. Commerce Department.

Date created: 09/15/2011
Last updated: 10/19/2015

Please email comments on this WWW page to alan.heckert@nist.gov.