<?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/bin2</title><revhistory><revision><revnumber>4</revnumber><date>2013-03-08 10:18:05</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>3</revnumber><date>2007-10-30 15:10:06</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>2</revnumber><date>2007-10-30 15:02:03</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>1</revnumber><date>2007-10-30 15:01:25</date><authorinitials>PeterWatson</authorinitials></revision></revhistory></articleinfo><section><title>Equivalence test for 2 unrelated proportions</title><para>H0 : -1 &lt; $$p_text{1}-p_text{2} \leq -\delta_text{1}$$ or $$\delta_text{2} \leq \delta &lt; 1$$ HA: $$-delta_text{1} &lt; \delta &lt; \delta_text{2}$$ </para><para>where proportions being compared are $$p_text{1}$$ = x/m and $$p_text{2}$$ = y/n, beta is the type II error,, del1 and del2 denote, $$\delta_text{1}$$ and $$\delta_text{2}$$. </para><para>[TYPE INTO R THE DESIRED INPUTS X,M,Y,N,DEL1,DEL2 AND BETA USING VALUES IN FORM BELOW]. </para><screen><![CDATA[beta <- 0.05
m <- 20
n <- 12
x <- 10
y <- 15
del1 <- 0.1
del2 <- 0.1]]></screen><para>[THEN COPY AND PASTE THE BELOW INTO R]  </para><para>If ind=1 we reject the null hypothesis of nonequivalence with a type II error of beta. </para><screen><![CDATA[denom <- sqrt((1/m)(x/m)(1-(x/m))+(1/n)(y/n)(1-(y/n)))
tstat <- abs(((x/m) - (y/n)) - (del2-del1)/2) / denom
cval <- qchisq(p=beta,  df=1, (del1+del2)^2/(4*denom*denom))
ind <- 0
if (tstat < cval) ind = 1
print(ind)]]></screen></section></article>