1. Home
  2. SMCNEMAR procedure

SMCNEMAR procedure

Calculates sample sizes for McNemar’s test (R.W. Payne).

Options

PRINT = string token What to print (replication, power); default repl, powe
PRMETHOD = string token Method to be used to calculate the power of the McNemar test (normalapproximation, exact); default exac
PROBABILITY = scalar Significance level at which the test is to be made; default 0.05
POWER = scalar The required power (i.e. probability of detection) of the test; default 0.9
TMETHOD = string token Whether a one- or two-sided test is to be made (onesided, twosided); default twos
REPLICATION = variate Sample sizes for which to calculate and print or save the power; default * takes 11 replication values centred around the required number of replicates

Parameters

CHANGEPROBABILITY = scalars Probability of any sort of change
RATIOPROBABILITIES = scalars Ratio of the two probabilities of change
NREPLICATES = scalars Saves the required sample size
VREPLICATION = variates Sample sizes for which powers have been calculated
VPOWER = variates Power (i.e. probability of detection) for the various numbers of replicates

Description

The McNemar test is useful for analysing studies where subjects are assessed before and after a treatment. The response on each occasion is assumed to be categorized by a factor with two levels, with level 1 usually representing a negative response, and level 2 a positive response. The test is based on a table giving the numbers of subjects giving each combination of responses over the two occasions. Suppose that the table contains the values A, B, C and D as below:

  Second occasion
First occasion negative positive
positive A B
negative C D

The test statistic assesses the equality of A and D, which represent the changes from positive to negative, and negative to positive, respectively. See procedure MCNEMAR or Siegel (1956), pages 63-67.

In its original form, the test leads to a chi-square test. However, this may be inaccurate when there are small numbers of subjects. Consequently procedure MCNEMAR also provides an exact probability (based on the binomial distribution). Similarly SMCNEMAR has an option, PRMETHOD, to select whether you want to calculate the power of the test by approximating the probabilities by a Normal distribution, or using the binomial distribution as in the exact calculation (settings normalapproximation and exact, respectively). The default is exact.

To calculate the sample size, SMCNEMAR needs to know the overall probability of change (i.e. the probability of a subject being amongst those in either A or D), and the ratio of the probabilities of the two types of change (A versus D). These are specified by parameters CHANGEPROBABILITY and RATIOPROBABILITIES, respectively. By default the calculations are done for a one-sided test (testing for evidence that the change is in a specific direction (e.g. negative to positive). However, you can set option TMETHOD=twosided for a two-sided test (testing for either type of change). The significance level for the test is specified by the PROBABILITY option (default 0.05 i.e. 5%). The required probability for detection of the change (that is, the power of the test) is specified by the POWER option (default 0.9). The sample size can be saved using the NREPLICATES parameter.

The PRINT option controls printed output, with settings:

    replication to print the required number of replicates in each sample (i.e. the size of each sample);
    power to print a table giving the power (i.e. probability of detection) provided by a range of numbers of replicates.

By default both are printed.

The replications and corresponding powers can also be saved, in variates, using the VREPLICATION and VPOWER parameters. The REPLICATION option can specify the replication values for which to calculate and print or save the power; if this is not set, the default is to take 11 replication values centred around the required number of replicates.

Options: PRINT, PRMETHOD, PROBABILITY, POWER, TMETHOD, REPLICATION.

Parameters: CHANGEPROBABILITY, RATIOPROBABILITIES, NREPLICATES, VREPLICATION, VPOWER.

Method

The sample size is first calculated by taking a Normal approximation to the probabilities:

NREPLICATES = CEILING( (\

        ( ( EDNORMAL(POWER) * SQRT(prob * (1 - prob))\

          - EDNORMAL(alpha) * 0.5 )\

          / (prob - 0.5) )**2 ) / CHANGEPROBABILITY)

where alpha is the significance level for the null hypothesis, and prob is the minimum of

1 / (1 + RATIOPROBABILITIES)

and

RATIOPROBABILITIES / (1 + RATIOPROBABILITIES)

With the exact calculation, this provides an initial estimate for a search for the required size, with probabilities calculated using the binomial distribution. Note: the exact calculation generally leads to sample sizes about 10% larger than those derived using the Normal approximation.

Reference

Siegel S. (1956). Nonparametric Statistics for the Behavioural Sciences. McGraw-Hill, New York.

See also

Procedure: MCNEMAR.

Commands for: Design of experiments.

Example

CAPTION  'SMCNEMAR example'; STYLE=meta
SMCNEMAR CHANGEPROBABILITY=0.7; RATIOPROBABILITIES=2
Updated on March 5, 2019

Was this article helpful?