開始使用免費開始

條件比例

下列程式碼分別產生聯合比例與條件比例的表格:

tab <- table(comics$align, comics$gender)
options(scipen = 999, digits = 3) # Print fewer digits
prop.table(tab)     # Joint proportions
prop.table(tab, 2)  # Conditional on columns

請在主控台執行。大約有多少比例的女性角色屬於 good?

本練習屬於課程

R 的探索式資料分析

檢視課程

動手互動練習

將理論付諸實踐,立即體驗我們的互動練習

開始練習