ebook img

Stata v 12 Stratified Analysis of K 2x2 tables - UMass Amherst PDF

14 Pages·2013·0.39 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Stata v 12 Stratified Analysis of K 2x2 tables - UMass Amherst

PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables Stratified Analysis of K 2x2 Tables Is the association of coffee with myocardial infarction different, depending on smoking status (“effect modification”)? If the association is the same, regardless of smoking status, is there an association of coffee consumption with myocardial infarction at all? This is an example of a stratified analysis of an exposure-disease relationship. A stratified analysis of K 2x2 tables is used to assess: (1) evidence of modification of an exposure-disease relationship by changes in the value of a third (stratifying) variable; or (2) in the absence of modification, a Mantel-Haenszel analysis of an exposure disease relationship controlling for confounding. Data Source: In this illustration, a data set is created in Stata using the data editor tool. The data are in tabular form. The expand function is used to convert the tabular data into a full data set that contains one record per subject. The sample size is n = 494. 1. Introduction and Example ………………………………………………………..……..……..… 2 2. Entering Tabular Data ……………………………………………………………………….…… 3 3. Descriptives – Numerical ………………………………………………………………………… 7 4. Descriptives – Graphical …………………………………………………………………………. 10 5. Mantel Haenszel Test of Null: Homogeneity of Odds Ratio ……………………………………. 13 6. Mantel-Haenszel Test of Null: Odds Ratio = 1 ………………………………………….. 14 COMMON …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 1 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables 1. Introduction and Example Example - Note – This is a subset of the data used in the Unit 4 (Categorical Data Analysis) practice problems. . Source: Fisher LD and Van Belle G. Biostatistics: A Methodology for the Health Sciences. New York: Wiley, 1993. Chapter 6 problem 14, page 235. Rosenberg et al (1980) performed a retrospective study of the association of coffee drinking (exposure) and the occurrence of myocardial infarction (MI) (outcome) among n=494. Information on smoking was also available. The analysis investigated possible modification of the coffee-MI relationship with smoking status (stratification). The data are in tabular form. Stratum 1: FORMER SMOKER Cups Coffee per day MI Control > 5 7 18 < 5 20 112 Stratum 2: 1-14 CIGARETTES/DAY Cups Coffee per day MI Control > 5 7 24 < 5 33 11 Stratum 3: 35-44 CIGARETTES/DAY Cups Coffee per day MI Control > 5 27 24 < 5 55 58 Stratum 4: 45+ CIGARETTES/DAY Cups Coffee per day MI Control > 5 30 17 < 5 34 17 …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 2 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables 2. Entering Tabular Data Tabular data is convenient for data entry. The result, however, is data in collapsed form. For example, consider the first table on the previous page. It shows that there are 7 individuals who are former smokers (stratum=1) who drank 5+ cups of coffee per day and who experienced an MI. We will enter this record just once and keep track of the frequency of this observation equal to 7 using a variable called tally. Tip – It is possible to analyze tabular data in Stata. Each profile of variable values is “weighted” by their frequency of occurrence (in our case by the variable tally). However, there are some analyses that we might want to do that cannot be performed using tabular data. For this reason, after entering the tabular data, the expand function is used to create a full data set. Coding Manual Tips – (1) Always create a coding manual before creating a data set (2) Use “lower case” only variable names. Example - Variable Variable Label Format Format code definitions smoking Smoking Status smokingf 1 = Former smoker 2 = 1-14 cigs/day 3 = 35-44 cigs/day 4 = 45+ cigs day coffee Cups Coffee Per Day coffeef 0 = < 5 cups/day 1 = 5+ cups/day mi Myocardial Infarction mif 0 = control 1 = case (MI) tally Frequency weight - - …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 3 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables Tip – Before proceeding, be sure you have started a log of your session in “.log” format! . * . ***** Illustration: Entering Tabular Data . set more off . * . ***** Initialize variable names and set initial value to missing. . generate smoking=. . generate coffee=. . generate mi=. . generate tally=. . * . ***** Click on the data editor icon. You should see the following empty spreadsheet. …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 4 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables . * . ***** Enter your data. Note – Enter your table by table, beginning with the first table (smoking =1 for the “Former smokers”) as follows. For each table, enter the data row by row, beginning with the first row. When you are done, your completed spreadsheet should be populated exactly as shown below. Close the data editor window. Don’t worry! Your data is not lost. . * . ***** Close the data editor window to return to the command window. …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 5 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables . * . ***** Assign variable names. Create value labels. Assign value labels. . label variable smoking "Stratum of Smoking" . label variable coffee "Cups of Coffee/Day" . label variable mi "MI - Myocardial Infarction" . label define smokingf 1 "Former Smoker" 2 "1-4 cigs/day" 3 "35-44 cigs/day" 4 "45+ cigs/day" . label define mif 1 "MI" 0 "Non-MI" . label define coffee 1 “5+cups” 0 “Less” . label values smoking smokingf . label values coffee coffeef . label values mi mif . * . ***** Save tabular data in stata data set called coffeemi_tabular.dta . save "/Users/carolbigelow/Desktop/coffeemi_tabular.dta" file /Users/carolbigelow/Desktop/coffeemi_tabular.dta saved . * . ***** Create expanded data set. Check. Save as coffeemi_full.dta . expand tally (478 observations created) . drop tally . save "/Users/carolbigelow/Desktop/coffeemi_full.dta" file /Users/carolbigelow/Desktop/coffeemi_full.dta saved …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 6 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables 3. Descriptives - Numerical Stata offers several commands for producing descriptives. Some results are more compact than others. The following are some suggestions. . * . ***** 3a) xtab of coffee by mi - OVERALL . tab2 coffee mi, row column -> tabulation of coffee by mi +-------------------+ | Key | |-------------------| | frequency | | row percentage | | column percentage | +-------------------+ | MI - Myocardial Cups of | Infarction Coffee/Day | Non-MI MI | Total -----------+----------------------+---------- Less | 198 142 | 340 | 58.24 41.76 | 100.00 | 70.46 66.67 | 68.83 -----------+----------------------+---------- 5+ cups | 83 71 | 154 | 53.90 46.10 | 100.00 | 29.54 33.33 | 31.17 -----------+----------------------+---------- Total | 281 213 | 494 | 56.88 43.12 | 100.00 | 100.00 100.00 | 100.00 …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 7 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables . * . ***** 3b xtab of coffee by mi - by strata of SMOKING . sort smoking . by smoking: tab2 coffee mi, row column -> smoking = Former Smoker -> tabulation of coffee by mi +-------------------+ | Key | |-------------------| | frequency | | row percentage | | column percentage | +-------------------+ | MI - Myocardial Cups of | Infarction Coffee/Day | Non-MI MI | Total -----------+----------------------+---------- Less | 112 20 | 132 | 84.85 15.15 | 100.00 | 86.15 74.07 | 84.08 -----------+----------------------+---------- 5+ cups | 18 7 | 25 | 72.00 28.00 | 100.00 | 13.85 25.93 | 15.92 -----------+----------------------+---------- Total | 130 27 | 157 | 82.80 17.20 | 100.00 | 100.00 100.00 | 100.00 ---- some output omitted ---- -> smoking = 45+ cigs/day | MI - Myocardial Cups of | Infarction Coffee/Day | Non-MI MI | Total -----------+----------------------+---------- Less | 17 34 | 51 | 33.33 66.67 | 100.00 | 50.00 53.12 | 52.04 -----------+----------------------+---------- 5+ cups | 17 30 | 47 | 36.17 63.83 | 100.00 | 50.00 46.88 | 47.96 -----------+----------------------+---------- Total | 34 64 | 98 | 34.69 65.31 | 100.00 | 100.00 100.00 | 100.00 …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 8 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables . * . ***** 3c) Compact display of % experiencing an MI, in each category of smoking and coffee Wonderful Tip!! Because the variable mi that we created is coded as 0=NON MI and 1=MI, the value of the sample mean of mi will be equal to the % who experience MI . tabulate smoking coffee, summarize(mi) means Means of MI - Myocardial Infarction Stratum of | Cups of Coffee/Day Smoking | Less 5+ cups | Total -----------+----------------------+---------- Former Sm | .15151515 .28 | .17197452 1-4 cigs/ | .75 .22580645 | .53333333 35-44 cig | .48672566 .52941176 | .5 45+ cigs/ | .66666667 .63829787 | .65306122 -----------+----------------------+---------- Total | .41764706 .46103896 | .43117409 Illustration of interpreting this table: (1) Overall, 43% experienced an MI (2) Among former smokers whose coffee consumption is “LESS”, 15% experienced an MI Etc. …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 9 of 14 PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables 4. Descriptives - Graphical Stata also offers several graphical options. Two are shown here. One is a bar graph, which is often used but not always a great choice. The second is a plot of the odds ratios, together with their 95% confidence limits. . * . ***** 4a) GRAPH - Bar Graph of % Experiencing MI over coffee and smoking . set scheme s2color . graph bar mi, over(coffee, gap(10)) over(smoking, gap(80)) outergap(50) ytitle("Proportion Experiencing MI") title("Coffee and MI") subtitle("by Smoking Status") ylabel(0(.2)1) caption("mi_bar.png", size(vsmall)) …\STATA v 12 stratified analysis of K 2x2 tables.doc Page 10 of 14

Description:
PubHlth 640 – Spring 2013 Stata v 12 Stratified Analysis of K 2x2 Tables
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.