Chi-square 用途4
Data Science Day 6:
Chi-square application 3:
Test for Homogeneity of One Categorical Variable across serveral sample spaces.
We use theChi-square test for Homogeneityto evaluate if one single categorical variable has a similar distribution (or frequency proportion)across two or more sample spaces (or populations).
Example:
Couple make-up companies wish to determine if there are differences in the sales market for China, USA, and Spain.
Customers China USA Spain
Buy 10000 2000 1000
Not Buy2013 391 212
H0(Null Hypotheses):The sales market has thesame distribution(frequency proportion) in China, USA, and Spain.
Solution:
we will useSciPypackage andchi2_contingencyfunction in Python.
Python Code:
country_buyer=np.array([[10000,2013],[2000,391],[1000,212]])
stats.chi2_contingency(country_buyer)
Result:
We havep-value= 0.69, so weacceptthe Null Hypotheses and conclude the Make up customerdistribution is the samein China, USA and Spain.
Data visualization:
We can see from the graph, the makeup customer has a similar distribution for China, USA, and Spain. It consolidated our statistical results.
Code:
I think it is human nature to pursue beauty and a decent amount of makeup does help men/women to level up our confidence, but I always remind myself don't be obsessed with external beauty.Everyone shines in our own way, and we are already pretty enough! After all, Venus has a broken arm.
To be continue...
作者:烏然婭措
連結:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/132/viewspace-2817297/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Typescript 推理及其用途TypeScript
- USB E-Maker用途
- 物件方法用途記錄物件
- 租用伺服器用途伺服器
- 雲主機的用途
- 併發有何用途?
- Python爬蟲的用途Python爬蟲
- 資料庫用途分類資料庫
- firewalld: 各個zone的用途
- 爬蟲的用途有哪些爬蟲
- CDN的用途是什麼
- CSS filter 有哪些神奇用途CSSFilter
- Lambda擴充套件與用途套件
- 按用途分類的SRAM
- Kubernetes裡的ConfigMap的用途
- update-initramfs的用途和功能
- 租用伺服器都有哪些用途伺服器
- 電商CRM的作用和用途
- C#單例模式的用途C#單例模式
- 私鑰的用途是什麼?
- 伺服器的作用及用途伺服器
- 伺服器有什麼用途伺服器
- VPS主機的用途有哪些?
- JavaScript解構賦值的用途JavaScript賦值
- 2023年4月美國人對人工智慧用途不太擔心比例(附原資料表) 人工智慧
- 2023年4月美國人對人工智慧用途不擔心比例(附原資料表) 人工智慧
- 2023年4月美國人對人工智慧用途非常擔心比例(附原資料表) 人工智慧
- 2023年4月美國人對人工智慧用途有點擔心比例(附原資料表) 人工智慧
- 整合開發環境(IDE)的用途?開發環境IDE
- JavaScript 函式 window.matchMedia 的用途JavaScript函式
- 代理IP的四大用途
- 區塊鏈的用途並不多 - calpaterson區塊鏈
- 伺服器的用途有哪些呢?伺服器
- 代理IP是否可以按用途分類
- 反向代理含義及用途介紹
- 海外伺服器有什麼用途?伺服器
- 顯示卡伺服器的用途伺服器
- 【DBA】DBA_HIST_SQLSTAT檢視用途SQL