postscript("l07.ps");options(width=68)
##############################################################
# Mark a: Arcsine transformaton                              #
##############################################################
plot(atan(1)*c(-4,4),c(-1,1),type="n",
   xlab="x",ylab="\\sin(x)")
theta<-(-25:25)/100*8*atan(1)
lines(theta,sin(theta),lty=1, xlab="x",ylab="\\sin(x)")
lines(theta<-(-50:(-25))/100*8*atan(1),sin(theta),type="l",
   xlab="x",ylab="\\sin(x)",lty=2)
lines(theta<-(25:50)/100*8*atan(1),sin(theta),type="l",
   xlab="x",ylab="\\sin(x)",lty=2)
axis(1,at=2*c(-2,-1,1,2)*atan(1),
   labels=c("-\\pi","-\\pi/2","\\pi/2","\\pi"))
plot((0:100)/100, asin(sqrt((0:100)/100)), xlab = "p",
   ylim=c(0,asin(1)),
   ylab = "\\arcsin(\\sqrt{p})",type = "l",xaxs="i",yaxs="i")
axis(4,at=c(30,60,90)/90*asin(1),labels=c(30,60,90))
#*************************************************************/
# Mark A: Binomial Power                                     */
#*************************************************************/
#R does the arscin transformation most easily
library(pwr)
pwr.p.test(h=ES.h(.5,.6),n=100)
pwr.p.test(h=ES.h(.5,.6),power=.8)
#***********************************************************
#Mark B: Mantel Haenszel Power                              
#***********************************************************
#Power for Henhose example,with 9 treatment and 9 control 
#chicks per lab.  Furthermore, suppose 1/9 to 6/9 abnormalit-
#ies per lab.  controls per lab.  So the null variance is   
da<-2*(1:6)
sd<-sqrt(sum(da*(18-da)*9*9/(18*18*19)))