最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

distribution - generate samples of proportions - Stack Overflow

programmeradmin1浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论