admin管理员组文章数量:1345134
Kia ora.
I have a data set where I am trying to generate 1000 samples of size n=5, where i am wanting to gather data only on measurements over 15m, to be produced to a sampling distribution for the sample mean.
this has been my code so far
d <- read.csv("name_of_file")
sample1 <- sample(d$hgt, size=5, replace=F)
proportion_taller_than_15m <- mean(d$hgt >15)
my.proportion_taller_tahn_15m <- numeric(1000)
for(i in 1:1000){sample1 <- sample(d$hgt, size=5), replace F}
my.proportion_taller_than_15m[i] <- mean(sample1)
However i only get the value zero. Anyone have any ideas?
本文标签: distributiongenerate samples of proportionsStack Overflow
版权声明:本文标题:distribution - generate samples of proportions - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743803634a2541775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论