2022년 11월 17일 목요일

Excel and Statistics(28), Mantel-Haenszel test

Excel and Statistics, everybody should know.  : Contents  

Mantel-Haenszel test

The second sheet of the ‘Mantel-Haenszel_test.xlsx’ shows the data. Column 1 usually means a country or region or research center. Column 2 refers to the cause, risk factor, or treatment of the disease, and column 3 has the result.

Currently, in this data, area(column 1) is from 1 to 24, and exposure(column 2)  and result(column 3) are 0 and 1. You can also put No, Yes instead of 0 and 1.

Summarizing this material, 2 by 2 tables can be summarized in the form of multiple tables. That’s why the Mantel-Haenszel test is usually expressed as 2×2×K.

Use Excel’s ‘Pivot Table’ to organize data. It is important to ensure that ‘area’ is placed above and ‘exposure’ is placed below in ‘row’ and ‘count’ in ‘value’. As a result, it was summarized as 2×2×K.

 

Copy the resulting pivot table (Ctrl A followed by Ctrl C) and paste it so that it fits the first sheet (Ctrl V).Œ This automatically copies the values into the yellow cell on the right and calculates the odds ratio and confidence interval for each 2 by 2 tableŽ. In other words, you can think of it as performing a chi-square test for each country (region). Each country or region is called a strata, which can be thought of as 2 by 2 tables with multiple strata.

 

 The bottom of the sheet shows the combined results, and their weighted odds ratio, or crude odds ratio, and confidence intervals.

‘Test for homogeneity’ shows a different odds ratio for each strata, which is examined to see if the odds are consistent, and is determined to be inconsistent (p=0.000) .

Considering that each strata has a different total number, the p-value and odds ratio of Mantel-Haenszel test also shows that there is a statistically significant relationship between exposure and result.

 

If you look at the plot provided by the sheet, it’s easy to see how the odds ratio differs for each strata.

This is a slight variation of an Excel file from ‘epibasic’, which I made to make it easier to take advantage of pivot table. The original file is described next.

 

 You can download the Excel file and manual and view it for yourself to get more information.

(http://ph.medarbejdere.au.dk/undervisning-og-uddannelse/software/ )

 

It allows you to run various statistics using Excel, and you can see that it has been updated recently.

 

In fact, there are many people who try more statistics using Excel, and there are many commercialized ones that allow statistical testing. However, I think that if you are going to try something more complex than Excel for more complex functions, it is not a bad idea to try other tools that are more specialized than Excel. That’s why I’ve added a way to use R appropriately through ‘plus alpha’ in this book.

What I really want to add is that Excel is much more comfortable and intuitive for basic and simple things, so make sure you get used to Excel even if you use R or something else.

 

 

=================================================

  • R data visualization book 2
https://tinyurl.com/R-plot-II-2  simple variables
https://tinyurl.com/R-plot-II-3-4   many variables / map
https://tinyurl.com/R-plot-II-5-6   time related / statistics related
https://tinyurl.com/R-plot-II-7-8   others / reactive chart 
 


 

 

 


댓글 없음:

댓글 쓰기