示例:在 R 中应用中心极限定理
假设龟壳的宽度遵循均匀分布,最小宽度为 2 英寸,最大宽度为 6 英寸。
也就是说,如果我们随机选择一只海龟并测量其壳的宽度,它同样可能是2 到 6 英寸之间的任何 宽度。
以下代码显示如何在 R 中创建一个数据集,其中包含 1,000 只海龟的壳宽测量值,均匀分布在 2 到 6 英寸之间:
#make this example reproducible
set.seed(0)
#create random variable with sample size of 1000 that is uniformally distributed