[問題] 請問如何用R做Z-test

看板Statistics作者 (nono)時間17年前 (2009/01/10 23:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
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
文章代碼(AID): #19QBqLUG (Statistics)
文章代碼(AID): #19QBqLUG (Statistics)