我現在正在介紹統計類,並且完全不知道發生了什麼。我如何使用R解決以下問題?使用R計算樣本均值的概率
設x是一個連續的隨機變量,它具有均值爲71,標準差爲15的正態分佈。假設n/N小於或等於0.05,找出樣本均值x-酒吧,從這個人口中抽取的24個隨機樣本將在68.1和78.3之間,
我真的很努力在這一個,我仍然必須通過相同格式的其他問題。任何幫助將不勝感激!
我現在正在介紹統計類,並且完全不知道發生了什麼。我如何使用R解決以下問題?使用R計算樣本均值的概率
設x是一個連續的隨機變量,它具有均值爲71,標準差爲15的正態分佈。假設n/N小於或等於0.05,找出樣本均值x-酒吧,從這個人口中抽取的24個隨機樣本將在68.1和78.3之間,
我真的很努力在這一個,我仍然必須通過相同格式的其他問題。任何幫助將不勝感激!
在代碼方面:
pop_sample <- rnorm(24, 71, 15)
se_pop <- sd(pop_sample)/sqrt(24)
pnorm(78.3, 71, se_pop) - pnorm(68.1, 71, se_pop) # 80%
在統計的術語......你或許應該參考stats.stackexchange.com或你的教授。
當R編碼,這可能爲您設置:
[# Children's IQ scores are normally distributed with a
# mean of 100 and a standard deviation of 15. What
# proportion of children are expected to have an IQ between
# 80 and 120?
mean=100; sd=15
lb=80; ub=120
x <- seq(-4,4,length=100)*sd + mean
hx <- dnorm(x,mean,sd)
plot(x, hx, type="n", xlab="IQ Values", ylab="",
main="Normal Distribution", axes=FALSE)
i <- x >= lb & x <= ub
lines(x, hx)
polygon(c(lb,x\[i\],ub), c(0,hx\[i\],0), col="red")
area <- pnorm(ub, mean, sd) - pnorm(lb, mean, sd)
result <- paste("P(",lb,"< IQ <",ub,") =",
signif(area, digits=3))
mtext(result,3)
axis(1, at=seq(40, 160, 20), pos=0)]
也有一些不錯的入門課程由datacamp R和數據分析,這也可能會派上用場: https://www.datacamp.com/courses/exploratory-data-analysis
另有關於R和統計學的教程: http://www.cyclismo.org/tutorial/R/confidence.html
我根本不是統計學家,但最近有一個類似的統計類。我認爲你正在尋找置信區間 – engineercoding
歡迎來到SO!請閱讀[問]和[mcve] ...然後編輯您的問題:http://stackoverflow.com/posts/43364072/edit並請閱讀http://stackoverflow.com/help/dont-ask – jogo
嘗試發佈您的問題在http://stats.stackexchange.com/代替 –