1. Home
  2. PAIRTEST procedure

PAIRTEST procedure

Performs t-tests for pairwise differences (P.W. Goedhart).

Options

PRINT = string tokens What to print (differences, sed, tvalues, tprobabilities); default diff, sed, tval
DF = scalar or symmetric matrix Degrees of freedom for calculation of TPROBABILITIES from TVALUES; default 10000, approximates to the normal distribution
SORT = string token Whether ESTIMATES (and other output) are sorted in ascending order (yes, no); default no

Parameters

ESTIMATES = variates Estimates to be compared
VCOVARIANCE = symmetric matrices Symmetric matrix containing the variance-covariance matrix of the estimates
LABELS = texts Text vector naming the elements of ESTIMATES; if unset, the numbers 1, 2… are used as labels
DIFFERENCES = symmetric matrices To save the pairwise differences (ESTIMATES on the diagonal)
SED = symmetric matrices To save the standard errors of the pairwise differences (missing values on the diagonal)
TVALUES = symmetric matrices To save the t-values (missing values on the diagonal)
TPROBABILITIES = symmetric matrices To save the t-probabilities (missing values on the diagonal)

Description

PAIRTEST can be used to test all pairwise differences in every situation in which a vector of estimates and a corresponding variance-covariance matrix are available. PAIRTEST is particularly useful for tests of all pairwise differences of slopes after fitting a model with an interaction between a factor and a variate. In most other situations procedure RPAIR will be more suitable.

All pairwise differences of entries in ESTIMATES with variance-covariance matrix VCOVARIANCE are calculated and tested. The results of these tests can be saved in symmetric matrices DIFFERENCES, SED, TVALUES and TPROBABILITIES. The matrices are labeled by text vector LABELS or, if LABELS is unset, by the numbers 1, 2, 3…

PRINT controls the output of PAIRTEST. The t-probabilities are based on DF degrees of freedom; by default, if DF has not been set, Normal probablitities are calculated. Option SORT controls whether the estimates on the diagonal of DIFFERENCES are sorted in ascending order. The other output is sorted accordingly.

Options: PRINT, DF, SORT.

Parameters: ESTIMATES, VCOVARIANCE, LABELS, DIFFERENCES, SED, TVALUES, TPROBABILITIES.

Method

The calculations are all relatively straightforward.

Action with RESTRICT

The variate ESTIMATES and the text LABELS can be restricted; the analysis is restricted according to restrictions on ESTIMATES. The lengths of the unrestricted vectors ESTIMATES and LABELS must be identical.

See also

Procedures: ALLDIFFERENCES, AMCOMPARISON, AUMCOMPARISON, PPAIR, RPAIR.

Commands for: Regression analysis.

Example

CAPTION 'PAIRTEST example',\
        !t('Comparison of slopes following a regression with grouped data.',\
        'Data from Wetherill, G.B. (1981), Intermediate Statistical',\
        'Methods, Chapman & Hall, London, page 247.'); STYLE=meta,plain
TEXT    [VALUES=OwnRoots,ComPlum,ComMussel,Myrobalan] Labels
FACTOR  [LABELS=Labels; VALUES=9(1...4)] Plumtree
VARIATE [NVALUES=36] CirBase,CirTop,Weight
READ    CirBase,CirTop,Weight
      1.690  1.663  2.318     1.583  1.568  2.100     1.693  1.643  2.225
      1.648  1.609  2.140     1.628  1.599  2.107     1.600  1.603  2.049
      1.677  1.640  2.228     1.588  1.535  2.029     1.645  1.606  2.140
      1.525  1.515  1.940     1.517  1.501  1.940     1.582  1.542  2.045
      1.537  1.529  1.919     1.504  1.487  1.869     1.589  1.562  2.049
      1.567  1.548  1.954     1.480  1.449  1.820     1.498  1.490  1.892
      1.604  1.540  2.104     1.650  1.633  2.233     1.591  1.581  2.090
      1.598  1.579  2.079     1.672  1.629  2.255     1.585  1.555  2.064
      1.645  1.610  2.185     1.628  1.612  2.068     1.653  1.642  2.201
      1.747  1.712  2.382     1.769  1.754  2.413     1.763  1.747  2.446
      1.766  1.738  2.450     1.739  1.719  2.387     1.749  1.742  2.396
      1.738  1.710  2.310     1.731  1.689  2.332     1.707  1.650  2.204 :
MODEL     Weight
TERMS     [FULL=yes] CirBase + Plumtree * CirTop
FIT       [CONSTANT=omit; PRINT=estimates] CirBase + Plumtree / CirTop
RKEEP     ESTIMATES=Est; VCOVAR=Vcov; DF=Df
TEXT      [VALUES=5(no),#Labels] NewLabel
RESTRICT  Est; CONDITION=NewLabel .NI. 'no'
PAIRTEST  [DF=Df] ESTIMATES=Est; VCOVAR=Vcov; LABELS=NewLabel
Updated on March 6, 2019

Was this article helpful?