friedman.test 位於 stats 包(package)。 說明
使用未複製的阻塞數據執行 Friedman 秩和檢驗。
用法
friedman.test(y, ...)
## Default S3 method:
friedman.test(y, groups, blocks, ...)
## S3 method for class 'formula'
friedman.test(formula, data, subset, na.action, ...)
參數
| y | 數據值的數值向量或數據矩陣。 | 
| groups | 如果這是一個向量,則給出  | 
| blocks | 如果這是一個向量,則給出  | 
| formula | 
 | 
| data | 包含公式  | 
| subset | 一個可選向量,指定要使用的觀測子集。 | 
| na.action | 一個函數,指示當數據包含  | 
| ... | 要傳遞給方法或從方法傳遞的更多參數。 | 
細節
friedman.test 可用於分析未複製的完整模塊設計(即,對於 groups 和 blocks 級別的每種組合,y 中恰好有一個觀察結果),其中可能違反正態性假設。
原假設是,除了blocks 的影響之外,y 的位置參數在每個groups 中都是相同的。
如果y是矩陣,則分別從列索引和行索引獲得groups和blocks。 NA 不允許出現在 groups 或 blocks 中;如果 y 包含 NA ,則刪除相應的塊。
值
類"htest" 的列表包含以下組件:
| statistic | 弗裏德曼卡方統計量的值。 | 
| parameter | 檢驗統計量的近似卡方分布的自由度。 | 
| p.value | 檢驗的 p 值。 | 
| method | 字符串  | 
| data.name | 給出數據名稱的字符串。 | 
例子
## Hollander & Wolfe (1973), p. 140ff.
## Comparison of three methods ("round out", "narrow angle", and
##  "wide angle") for rounding first base.  For each of 18 players
##  and the three method, the average time of two runs from a point on
##  the first base line 35ft from home plate to a point 15ft short of
##  second base is recorded.
RoundingTimes <-
matrix(c(5.40, 5.50, 5.55,
         5.85, 5.70, 5.75,
         5.20, 5.60, 5.50,
         5.55, 5.50, 5.40,
         5.90, 5.85, 5.70,
         5.45, 5.55, 5.60,
         5.40, 5.40, 5.35,
         5.45, 5.50, 5.35,
         5.25, 5.15, 5.00,
         5.85, 5.80, 5.70,
         5.25, 5.20, 5.10,
         5.65, 5.55, 5.45,
         5.60, 5.35, 5.45,
         5.05, 5.00, 4.95,
         5.50, 5.50, 5.40,
         5.45, 5.55, 5.50,
         5.55, 5.55, 5.35,
         5.45, 5.50, 5.55,
         5.50, 5.45, 5.25,
         5.65, 5.60, 5.40,
         5.70, 5.65, 5.55,
         6.30, 6.30, 6.25),
       nrow = 22,
       byrow = TRUE,
       dimnames = list(1 : 22,
                       c("Round Out", "Narrow Angle", "Wide Angle")))
friedman.test(RoundingTimes)
## => strong evidence against the null that the methods are equivalent
##    with respect to speed
wb <- aggregate(warpbreaks$breaks,
                by = list(w = warpbreaks$wool,
                          t = warpbreaks$tension),
                FUN = mean)
wb
friedman.test(wb$x, wb$w, wb$t)
friedman.test(x ~ w | t, data = wb)
參考
Myles Hollander and Douglas A. Wolfe (1973), Nonparametric Statistical Methods. New York: John Wiley & Sons. Pages 139-146.
也可以看看
相關用法
- R formula 模型公式
- R factor.scope 計算在公式中添加或刪除時允許的更改
- R factanal 因子分析
- R fitted 提取模型擬合值
- R ftable 扁平列聯表
- R ftable.formula 平麵列聯表的公式表示法
- R filter 時間序列的線性過濾
- R family 模型的族對象
- R formula.nls 從 nls 對象中提取模型公式
- R fivenum 圖基五數摘要
- R fisher.test 計數數據的 Fisher 精確檢驗
- R fft 快速離散傅立葉變換 (FFT)
- R fligner.test 方差齊性的 Fligner-Killeen 檢驗
- R stlmethods STL 對象的方法
- R medpolish 矩陣的中值波蘭(穩健雙向分解)
- R naprint 調整缺失值
- R summary.nls 總結非線性最小二乘模型擬合
- R summary.manova 多元方差分析的匯總方法
- R nls.control 控製 nls 中的迭代
- R aggregate 計算數據子集的匯總統計
- R deriv 簡單表達式的符號和算法導數
- R kruskal.test Kruskal-Wallis 秩和檢驗
- R quade.test 四方測試
- R decompose 移動平均線的經典季節性分解
- R plot.stepfun 繪製階躍函數
注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Friedman Rank Sum Test。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
