search for: nonrisk

Displaying 1 result from an estimated 1 matches for "nonrisk".

Did you mean: minrisk
2006 Jul 03
2
help a newbie with a loop
...(m+1)/m)*sp2/sx)) if(n0==n1) break n0<-n1 } return(c(sx,n1)) } x<-rnorm(1000,0,1) x<-x[order(x)] res<-matrix(0,1000,2) #use the function and plot for different values of ind and p for ( p in c(0.05,0.10,0.15,0.20,0.25,0.30,0.40,0.50)) { risk<-p*(2-p) nonrisk<-(1-p)^2 m<-nonrisk/risk for (ind in 1:500) {res[ind,]<-powerb(x[c(1:(500-ind),(500+ind):1000)],4,0.05,0.20,0.1,m)} plot(res[,1],res[,2],type="p",ylab="n",xlab="var(x)",main="b=0.1,power=0 .80,alpha=0.05,dominant met p=0.25")} I would appr...