#Excess variability: i.i.d. scenario comapred to the non-i.i.d. scenario: n <- seq(5,35,5) rho <- seq(.2,.8,.1) x <- rep(0,49) M <- matrix(x, 7,7) for(i in 1:7){ for(j in 1:7){ M[i,j] <- 1+(n[i]-1)*rho[j] } } #=============================== #Coverage probability of a confidence interval for the mean when ingnoring dependency: n <- seq(5,35,5) rho <- seq(.2,.8,.1) x <- rep(0,49) M <- matrix(x, 7,7) for(i in 1:7){ for(j in 1:7){ q <- 1.96/(1+(n[i]-1)*rho[j])^.5 M[i,j] <- pnorm(q)-pnorm(-q) } }