search for: e2yht

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

Did you mean: 2yhm
2008 Jul 03
1
Problem in applying conditional looping
...mvnorm(n=n, mean=m, sigma=s) pi <- x[,2]/sum(x[,2]) P <- pi*((1-2*pi)/(1-pi)+sum(pi/(1-pi))) Pi<-t(combn(pi,2)) y<-t(combn(x[,1],2)) PI<-t(combn(P,2)) yht <- y[,1]/PI[,1]+ y[,2]/PI[,2] *PIJ <- (Pi[,1]*Pi[,2]*(2-Pi[,1]-Pi[,2]))/((1-Pi[,1])*(1-Pi[,2]))* Eyht <- sum(yht*PIJ) E2yht <- sum(yht^2*PIJ) var1 <- E2yht - Eyht^2 var1 } I want to impose the condition on PIJ(which is a vector). If any value in the PIJ is negative then go back and take another sample until a sample is selected which produces the PIJ positive(all values in PIJ). I hope now you can understand. Be...