> set.seed(1)
> n <- 1000000
> x <- rnorm(n)
> I <- x >= 20
> for(i in 1:n){
+ if(I[i] == TRUE)
+ i[I] <- 1
+ else
+ I[i] <- 0
+ }
> nl <- sum(I)
> theta.e <- nl/n
> sigma2.e <- sum((I - theta.e)^2)/(n * (n - 1))
> theta.e
[1] 0
> sigma2.e
[1] 0