※本ページの内容はテキストの第11章に相当します
本章では母集団の比率に関する推定と仮説検定を学びます。本章ではRcmdrで実行した場合のコードと出力結果のみを記載し、手順の記載は省略しますので詳細はテキストを参照してください。
データの読み込み
- Rcmdrのメニューから[データ]-[データセットのロード…]を実行する
- ファイルダイアログで「
外来患者ストレス.RData
」ファイルを選択する - アクティブデータセットが
PatientStress
になっていることを確認する
11.1 1標本における比率に関する検定
統計量 - 比率 - 1標本比率の検定
Frequency counts (test is for first level):
ノンコンプライアンス
なし あり
202 135
1-sample proportions test with continuity correction
data: rbind(.Table), null probability 0.5
X-squared = 12.926, df = 1, p-value = 0.0003241
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.5447541 0.6517551
sample estimates:
p
0.5994065
11.2 2標本における比率に関する検定
統計量 - 比率 - 2標本比率の検定
Percentage table:
ノンコンプライアンス
性別 なし あり Total Count
男 57.1 42.9 100 119
女 61.5 38.5 100 218
2-sample test for equality of proportions with continuity correction
data: .Table
X-squared = 0.43309, df = 1, p-value = 0.5105
alternative hypothesis: two.sided
95 percent confidence interval:
-0.15965096 0.07315031
sample estimates:
prop 1 prop 2
0.5714286 0.6146789