当前位置:网站首页>Super simple case: how to do hierarchical chi square test?
Super simple case: how to do hierarchical chi square test?
2022-06-25 08:24:00 【spssau】
Chi square test study X and Y The difference of ,X and Y Are category data . At present, another disturbing factor layering item needs to be further considered . Like smoking or not (X) And whether you are ill (Y) The relationship between , Taking gender into account ( That is, confounding factors , Hierarchical item Factor). This is called hierarchical chi square , Layered chi square is also known as Cochran-Mantel-Haenszel test (CMH test ), Layered chi square can be a good solution ‘ Simpson paradox ’ problem .SPSSAU Support 2*2*K Structural data ( namely X and Y Are all 2 classification ,K layer ).
One 、 Theoretical explanation
Hierarchical chi square is based on Chi square test , Further consider the interference of layered terms ( Confounding factors ), It is usually necessary to analyze confounding factors ( Hierarchical item ) There is a certain degree of foreknowledge ( Or references ), Then the hierarchical chi square test .
- For layered chi square , It involves the following theoretical knowledge , The following table :
Usually , First of all to see ‘ Odds ratio homogeneity test ’, If it shows significance (p Less than 0.05), It indicates that there are confounding factors , That is, you need to consider hierarchical items , That is to view the data results under different layers . On the contrary, if it fails ‘ Odds ratio homogeneity test ’, That is to say, there are no confounding factors and there is no need to consider the stratification item , Just report the overall results ( Including chi square test , as well as OR value ). Cochran–Mantel–Haenszel Conditional independence was used to study confounding factors ( Hierarchical item ) after ,X And Y Whether there are still differences between , Relatively small .
Two 、 Layered chi square case
1、 background
There is a current study on the impact of smoking on the risk of colds , share 1046 Research subjects , And record whether you have a cold , Smoking or not , And gender information .
2、 Data description
Raw data ( Analog data ) as follows :
The raw data is in a weighted format .
- Whether to smoke , Numbers 1 Express ‘ smoking ’, Numbers 2 Express ‘ No smoking ’;
- Do you have a cold , Numbers 1 Express ‘ Catch a cold ’, Numbers 2 Express ‘ No colds ’.
- When stratified by gender , Numbers 1 Express ‘ male ’, Numbers 2 Express ‘ Woman ’, Numbers 3 Express ‘ A secret ’.
- Weighted terms weight Indicates the number of combinations of categories of each research object , such as 465 Express , The number of men who smoke and have a cold .
- Tips :
- For layered chi square ,SPSSAU Support 2*2*k structure , namely X and Y Are all 2 Categories , Whether to smoke and whether to catch a cold ,k Indicates the number of categories of hierarchical items ,( The cases are divided into ‘ male ’,‘ Woman ’ and ‘ A secret ’, Then for 3 layer ).
3、 Operation steps
This case uses the weighted data format , The operations for placing analysis items are as follows :
Use path :SPSSAU→ experiment / Medical research → Layered chi square
4、SPSSAU Output results
SPSSAU Co output 5 Class table , Here's how :
form | explain |
Cochran-Mantel-Haenszel test Basic explanation | Basic summary of analysis items . |
Hierarchical chi square test summary table | √ When showing layers and non layers ,X And Y Chi square test of ;√ Use fisher Chi square test , And show OR Values and 95% Section . |
Mantel-Haenszel Common Ratio OR Value estimate | Exhibition Mantel-Haenszel Common Ratio OR value , as well as OR The logarithm of the value , And show 95% Section . |
Odds ratio homogeneity test (Breslow-Day-Tarone) | Exhibition Breslow-Day Odds ratio homogeneity test . |
Cochran–Mantel–Haenszel Conditional independence test | Exhibition chran–Mantel–Haenszel Conditional independence test . |
① Hierarchical chi square test summary table
The table above shows each layer ( And no layering ) In this case , Data of each cross category item , And output OR Values and fisher Chi square value , For example, when there is no layering , That is, when gender is not considered at all ,‘ Smoking or not ’ And ‘ Do you have a cold ’ There is a significant difference between (χ2=15.136, p =0.000<0.01),OR The value is 2.077, That means smoking is a risk factor on the whole , And the risk of smoking is not smoking 2.077 times . But when considering hierarchically , Significant only in men (χ2=5.514, p =0.024<0.05), However, there is no significant difference between women and secret groups ( p > 0.05). That is to say, the existence of confounding factors may need to be considered ( That is, hierarchical items exist ), Next, the corresponding layered items will be inspected and explained .
②Mantel-Haenszel Common Ratio OR Value estimate
- Tips :
- here 95% The calculation of the confidence interval is based on the assumption that OR value =1 Calculate .
The table above shows Mantel-Haenszel Common Ratio OR value ,OR The value is 1.772, That means smoking is a risk factor on the whole , And the risk of smoking is not smoking 1.772 times (95% CI: 1.1760 ~ 2.6701).
③ Odds ratio homogeneity test results
The table above shows the odds ratio homogeneity test , By default Breslow-Day Method , The table above shows that the odds ratio homogeneity test was not passed (χ2=1.089, p=0. 5801>0.1), This means that the layers are homogeneous , There is no confounding , That is, there are no confounding factors ( Gender ), That is, it is not necessary to report the corresponding values of each layer separately ( such as OR value ), The overall report is sufficient , The overall... Can be reported here Mantel-Haenszel Common Ratio OR Value is 1.772.
SPSSAU Automatic output of intelligent analysis results :
④Cochran–Mantel–Haenszel Conditional independence test
The above table shows the conditional independence results ,Mantel-Haenszel Common The law rejects the original assumption (χ2=7.0547, p=0. 0079<0.01), That is to say, controlling confounding interference factors ( Gender ) after , There is still a significant difference between smoking and cold , and OR The value is 1.772, Smoking is a risk factor , And the risk of smoking is not smoking 1.772 times .
5、 Analysis of key points
① Layered chi square ,SPSSAU Support weighted and unweighted formats , A weighted format is usually used , Drop down selection during analysis ‘ Weighted terms ’ that will do .
② Whether there are confounding factors in the study of odds ratio homogeneity test ( That is, whether the existence of hierarchical items is meaningful ).
③ Mantel-Haenszel Common Ratio OR value , As a whole when chi square test is performed separately OR The values are not consistent ,Mantel-Haenszel Common Ratio OR The value can be understood as a correction OR value , But they have the same meaning .
边栏推荐
- 4 raisons inconnues d'utiliser le "déplacement sûr à gauche"
- How to do factor analysis? Why should data be standardized?
- 使用pytorch搭建MobileNetV2并基于迁移学习训练
- How to analyze the coupling coordination index?
- Force buckle 272 Closest binary search tree value II recursion
- 以科技赋能设计之美,vivo携手知名美院打造“产学研”计划
- 4个不可不知的采用“安全左移”的理由
- Rank sum ratio (RSR) index calculation
- Sword finger offer (medium level)
- leetcode.13 --- 罗马数字转整数
猜你喜欢
VOCALOID notes
Remove headers from some pages in a word document
Data-centric vs. Model-centric. The Answer is Clear!
使用apt-get命令如何安装软件?
Modeling and fault simulation of aircraft bleed system
How to calculate the correlation coefficient and correlation degree in grey correlation analysis?
C examples of using colordialog to change text color and fontdialog to change text font
C # set up FTP server and realize file uploading and downloading
How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
Force buckle 272 Closest binary search tree value II recursion
随机推荐
What problems do you worry about when you want to switch to software testing?
[QT] qtcreator shortcut key and QML introduction
[supplementary question] 2021 Niuke summer multi school training camp 1-3
Niuke: flight route (layered map + shortest path)
Electronics: Lesson 013 - Experiment 14: Wearable pulsed luminaries
Black dot = = white dot (MST)
软件确认测试有什么作用?确认测试报告的价格是多少?
Measure the current temperature
Go语言学习教程(十三)
Luogu p3313 [sdoi2014] travel (tree chain + edge weight transfer point weight)
Allgero reports an error: program has encoded a problem and must exit The design will be saved as a . SAV file
双周投融报:资本埋伏Web3基础设施
Electronics: Lesson 011 - experiment 10: transistor switches
图像超分综述:超长文一网打尽图像超分的前世今生 (附核心代码)
Luogu p5994 [pa2014]kuglarz (XOR thinking +mst)
Thread + thread problem record
Network model -- OSI model and tcp/ip model
TCP MIN_RTO 辩证考
Free SSL certificate acquisition tutorial
STM32CubeMX 學習(5)輸入捕獲實驗