Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How can I plot graph for sample variance versus sample size while putting random numbers from 1 to 20 in R language?
特林克可能会讨厌我回答这个问题,但这是一个带有许多假设的粗略示例:
sample.max <- 20000 sample.sizes <- seq(1, sample.max, by=10) myfun <- function (x){ var(sample(1:20, x, replace=TRUE)) } variances <- sapply(sample.sizes, myfun) plot(sample.sizes, variances, t='l')