<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FAQ/mcnequiv</title><revhistory><revision><revnumber>3</revnumber><date>2013-03-08 10:17:10</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>2</revnumber><date>2007-10-18 15:49:17</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>1</revnumber><date>2007-10-18 15:47:58</date><authorinitials>PeterWatson</authorinitials></revision></revhistory></articleinfo><section><title>Equivalence test for McNemar's test</title><para><ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/mcnequiv/statswiki/McNemar#">McNemar</ulink>'s test is described in the Categorical Data talk <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/FAQ/mcnequiv/statswiki/StatsCourse2007#">here</ulink>. </para><para>$$\delta$$ represents the true difference $$p_text{10} - p_text{01}$$ where $$p_text{ij}$$ = P(time 1 = i, time 2 = j) for dichotomous responses measured on each subject at times 1 and 2. </para><para>H0: $$\delta$$ $$\leq$$ -t or $$\delta$$ $$\geq$$ t </para><para>HA:   -t $$\leq$$ $$\delta$$ $$\leq$$ t </para><informaltable><tgroup cols="7"><colspec colname="col_0" colwidth="25*"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><colspec colname="col_5"/><colspec colname="col_6"/><tbody><row rowsep="1"><entry colsep="1" nameend="col_3" namest="col_0" rowsep="1"/><entry colsep="1" rowsep="1"/><entry colsep="1" nameend="col_6" namest="col_5" rowsep="1"><para>Time 2 </para></entry></row><row rowsep="1"><entry colsep="1" nameend="col_3" namest="col_0" rowsep="1"/><entry colsep="1" rowsep="1"/><entry colsep="1" rowsep="1"><para>  - </para></entry><entry colsep="1" rowsep="1"><para> + </para></entry></row><row rowsep="1"><entry colsep="1" nameend="col_3" namest="col_0" rowsep="1"><para> Time 1  </para></entry><entry colsep="1" rowsep="1"><para> - </para></entry><entry colsep="1" rowsep="1"><para>  n00 </para></entry><entry colsep="1" rowsep="1"><para> n01 </para></entry></row><row rowsep="1"><entry colsep="1" nameend="col_3" namest="col_0" rowsep="1"/><entry colsep="1" rowsep="1"><para> + </para></entry><entry colsep="1" rowsep="1"><para>  n10 </para></entry><entry colsep="1" rowsep="1"><para> n11 </para></entry></row></tbody></tgroup></informaltable><para>The R code uses the formulae of Wellek (2003) to test if the observed difference in proportions provides sufficient evidence to say that there is a relationship between times 1 and 2 by comparing the difference in proportions to a specified criterion difference 'tdel' between 0 and 1. </para><para>$$p_text{01}$$ and $$p_text{10}$$ are estimated using the inputted observed frequencies $$n_text{01}$$ and $$n_text{10}$$ from a sample of size, n. Type II error is beta (usually 0.05). </para><para>If ind equals 1 then we reject nonequivalence so -t $$\leq$$ $$\delta$$ $$\leq$$ t otherwise we accept the null hypothesis for the given type II error, beta. </para><para>[TYPE INTO R THE DESIRED INPUTS N, DELTA, N10, N01 AND BETA USING VALUES IN FORM BELOW].  </para><screen><![CDATA[n <- 72
tdel <- 0.20
n10 <- 5
n01 <- 4 
beta <- 0.05]]></screen><para>[THEN COPY AND PASTE THE BELOW INTO R] </para><screen><![CDATA[tstat <- (sqrt(n)*abs((n10-n01))) / sqrt(n*(n10+n01) - (n10-n01)^2 ) 
nc <- n^(3)*tdel^2 / (n*(n10+n01) - (n10-n01)^2)
cv <- sqrt(qchisq(p=beta,df=1,ncp=nc))
ind <- 0
if (tstat < cv) ind = 1
print(ind)]]></screen><para><emphasis role="underline">Reference</emphasis> </para><para>Wellek S (2003) Testing statistical hypotheses of equivalence. Chapman &amp; Hall/CRC Press.  </para></section></article>