cat("\n\nTYPE IN AN INTEGER SEED [1-9999999] FOLLOWED BY \"ENTER\"\n") test<-scan(file="",what=integer(0),n=1) seed.val<-test if(seed.val>0) { set.seed(seed.val) } cat("\n\nTYPE IN THE PREVALENCE OF EXPOSURE [0.001-0.999] FOLLOWED BY \"ENTER\"\n") test<-scan(file="",what=double(0),n=1) prevalence.exp<-test cat("\n\nTYPE IN THE RELIABILITY OF EXPOSURE [0.001-0.999] FOLLOWED BY \"ENTER\"\n") test<-scan(file="",what=double(0),n=1) reliability<-test sample.size<-4000000 var.b<-reliability var.w<-(1-var.b) pheno.orig<-rnorm(sample.size,0,sqrt(var.b)) error.obs1<-rnorm(sample.size,0,sqrt(var.w)) error.obs2<-rnorm(sample.size,0,sqrt(var.w)) pheno.obs1<-pheno.orig+error.obs1 pheno.obs2<-pheno.orig+error.obs2 pheno.true<-pheno.orig cov.table<-cov(cbind(pheno.obs1,pheno.obs2)) ICC<-cov.table[1,2] affected.threshold.true<-quantile(pheno.true,prevalence.exp) affected.threshold.obs1<-quantile(pheno.obs1,prevalence.exp) affected.true<-(pheno.true