Skip to Content
R 錦囊妙計
book

R 錦囊妙計

by Paul Teetor
January 2014
Beginner to intermediate
488 pages
8h 1m
Chinese
GoTop Information, Inc.
Content preview from R 錦囊妙計
250
|
第九章
試驗次數則為相對應班級中的學生人數:
> trials <- c(38,40)
如下所示,
prop.test
函數計算的
p
值為 0.3749
> prop.test(successes, trials)
2-sample test for equality of proportions with continuity correction
data: successes out of trials
X-squared = 0.7872, df = 1, p-value = 0.3749
alternative hypothesis: two.sided
95 percent confidence interval:
-0.1110245 0.3478666
sample estimates:
prop 1 prop 2
0.3684211 0.2500000
其中,根據較大的
p
值,我們無法拒絕虛無假設;換言之,證據不足以證明我的評分與
另一位同事的評分之間,具有統計上的顯著差異。
延伸資訊
錦囊 9.11
9.19 成對比較組平均數
問題點
您有多個樣本,而且您想成對比較樣本平均數。也就是說,您想要將每個樣本的平均值
與其他樣本的平均值逐一比較。
解決方案
將所有樣本資料另存為向量,並建立一個平行因子來辨識組別;使用
pairwise.t.test
函數進行平均數的成對比較:
> pairwise.t.test(x,f) # x 為樣本資料向量,f 是分組因子
主要觀察輸出結果的
p
值,其中每個
p
值對應至每個組對 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python数据科学

Python数据科学

肯尼迪·贝曼, 诺亚·吉夫特
Java数据科学实战

Java数据科学实战

Michael R. Brzustowicz, PhD

Publisher Resources

ISBN: 9789862769829