[問題] 請問如何用R做Z-test
Create 15 random numbers that are normally distributed with mean 10 and s.d. 5. Find a 1-sample z-test at the 95% level. Did it get it right?
這是我們的作業
單就這一題
我該怎樣操作R
做出Z檢定
課本有給範例
看不懂意思
> simple.z.test = function(x,sigma,conf.level=0.95) {
+ n = length(x);xbar=mean(x)
+ alpha = 1 - conf.level
+ zstar = qnorm(1-alpha/2)
+ SE = sigma/sqrt(n)
+ xbar + c(-zstar*SE,zstar*SE)
+ }
## now try it
> simple.z.test(x,1.5)
[1] 173.7703 175.6297
拜託各位先賢幫助我度過期末考!
--
聽說在簽名檔放上部落格網址可以增加當日人氣.....
http://www.wretch.cc/blog/nono611
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.118.232.96
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):