par1 <- as.numeric(par1) par2 <- as.numeric(par2) par3 <- as.numeric(par3) par4 <- as.numeric(par4) u <- (par2 - par3) / sqrt(par3 * (1-par3) / par1) pu <- pnorm(-abs(u)) load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Testing Population Proportion (normal approximation)',2,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Sample size',header=TRUE) a<-table.element(a,par1) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Sample proportion',header=TRUE) a<-table.element(a,par2) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Null hypothesis',header=TRUE) a<-table.element(a,par3) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Type I error (alpha)',header=TRUE) a<-table.element(a,par4) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'p-value (1-sided)',header=TRUE) a<-table.element(a,pu) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable.tab')
|