Created
May 5, 2020 09:55
-
-
Save jirilukavsky/adfeec817826508f1a7efb0b4a582779 to your computer and use it in GitHub Desktop.
Single variance estimate
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
# When we calculate variance (SD) from single observation (one group), | |
# how good/bad estimate this can be of the underlying SD? | |
B <- 100 | |
n <- 6 | |
m <- 50 | |
s <- 15 | |
estim_sd <- numeric(B) | |
set.seed(1010) | |
for (i in 1:B) { | |
x <- rnorm(n, mean = m, sd = s) | |
estim_sd[i] <- sd(x) | |
} | |
hist(estim_sd, breaks = seq(0, 40, by = 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment