In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about the application of Cochran-Mantel-Haenszel test in association analysis, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Cochran-Mantel-Haenszel, referred to as CMH test, is a test method to analyze the correlation between two binary classification variables. On the basis of 2 x 2 table data, the third classification variable is introduced, which is called mixed variable. The introduction of confounding variables makes the test can be used to analyze stratified samples. As a common technique in the field of biostatistics, this test is often used in disease control studies.
Let's take a look at the most basic example to study the correlation between different genders and candidates' voting results, and get the 2 x 2 table shown below.
There are two binary variables, the first is the gender of the voter, and the second is candidates An and B. Considering the stratification of all the voters themselves, they come from three different states and re-count for different states, and the results are as follows
In the above example, there is a stratification of voters from three different states. If you do not take this factor into account, directly count the gender and the frequency distribution of candidates, and use the chi-square or Fisher exact test for analysis, even if you get positive results, it is impossible to determine whether there is a real difference in voting between different genders or whether it is caused by a difference in voting from different states.
Because of the stratification of voters, it is not appropriate to directly use chi-square or Fisher exact test for analysis. In the above model, the stratification of voters is a typical mixed variable, and such data can be analyzed by CMH test.
The CMH test calculates the odd ratio value of each layer for each hierarchical statistical 2X2 table, and then calculates the common odd ratio after weighting. Each layer is represented by I. The statistical 2X2 table data is as follows
The calculation formula of common odd raio is as follows
As can be seen from the formula, the total number of samples in each layer is weighted, and the data used for CMH analysis requires a large sample size to ensure that zero does not appear in the frequency table of each layer. The statistical formula of the test is as follows
It obeys the chi-square distribution with 1 degree of freedom. The code for CMH test of the above data in R is as follows
The value of pvalue is more than 0.05. It shows that there is no correlation between gender and candidates. If the overall results are tested directly by chi-square or Fisher, the conclusion is on the contrary, and the calculation process is as follows.
From this data, it can be seen that for hierarchical samples, it is necessary to carry out CMH test. It should be noted that the CMH test assumes that the odd raio values of all layers are the same, which can be tested by Breslow-Day test. The code is as follows
The pvalue value is greater than 0.05, which means it does not satisfy the odd ratio homogeneity. Of course, for hierarchical data, in addition to CMH test, logical regression is also a good solution, and it is more general, and mixed variables can be treated as covariates in regression analysis.
About how the application of Cochran-Mantel-Haenszel test in association analysis is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.