R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '0.6' > par3 = '15' > par2 = '45' > par1 = '365' > ylab = '' > xlab = '' > main = '' > par1 <- 36500 > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > numsuccessbig <- 0 > numsuccesssmall <- 0 > bighospital <- array(NA,dim=c(par1,par2)) > smallhospital <- array(NA,dim=c(par1,par3)) > bigprob <- array(NA,dim=par1) > smallprob <- array(NA,dim=par1) > for (i in 1:par1) { + bighospital[i,] <- sample(c('F','M'),par2,replace=TRUE) + if (as.matrix(table(bighospital[i,]))[2] > par4*par2) numsuccessbig = numsuccessbig + 1 + bigprob[i] <- numsuccessbig/i + smallhospital[i,] <- sample(c('F','M'),par3,replace=TRUE) + if (as.matrix(table(smallhospital[i,]))[2] > par4*par3) numsuccesssmall = numsuccesssmall + 1 + smallprob[i] <- numsuccesssmall/i + } Error in if (as.matrix(table(smallhospital[i, ]))[2] > par4 * par3) numsuccesssmall = numsuccesssmall + : missing value where TRUE/FALSE needed Execution halted