Created
March 9, 2024 06:33
-
-
Save vasishth/f313df5b50f8902a4e18e965253178e5 to your computer and use it in GitHub Desktop.
The width of a CI is simply a function of the estimated sd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsim<-100000 | |
sd_est<-width<-rep(NA,nsim) | |
for(i in 1:nsim){ | |
y<-rnorm(10) | |
sd_est[i]<-sd(y) | |
ci<-t.test(y)$conf.int | |
width[i]<-ci[2]-ci[1] | |
} | |
plot(width,sd_est) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment