<?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/ncnpow</title><revhistory><revision><revnumber>5</revnumber><date>2013-03-08 10:17:39</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>4</revnumber><date>2008-02-28 15:11:24</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>3</revnumber><date>2008-02-28 15:11:13</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>2</revnumber><date>2008-02-28 15:10:05</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>1</revnumber><date>2008-02-28 15:09:53</date><authorinitials>PeterWatson</authorinitials></revision></revhistory></articleinfo><section><title>Power for using McNamr's test</title><para>The power, pow, is produced for <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/ncnpow/statswiki/McNemar#">McNemar</ulink>'s test comparing mismatch proportions, p12 and p21, in a sample size of ntot with a type I error of alpha. </para><para>Copy and Paste the inputs below into R and adjust as required. </para><screen><![CDATA[alpha <- 0.05
p12 <- 0.5
p21 <- 0.2
ntot <- 23]]></screen><para>Copy and paste the below into R to obtain the power. </para><screen><![CDATA[chisq <- ((p12-p21)^2) / (p12+p21)
pow <- 1 - pchisq(abs(qchisq(1-alpha,1)),1,ntot*chisq)
cat("Power for McNemar's test =")
print(pow)]]></screen></section></article>