Modeling the Prevalence of Breast Density Using SAS
Modeling the Prevalence of Breast Density Using SAS Veronica Burt
Reading in the Data options nofmterr; data BCSC. data 1; set BCSC. Dr 238 bs_sum_data_deid_v 3_1012; run;
Formatting the Data proc format; value age 1 = "40 -44" 2 = "45 -49" 3 = "50 -54" 4 = "55 -59" 5 = "60 -64" 6 = "65 -69" 7 = "70 -74" 8 = "75 -79" 9 = "80 -84" 10 = "85+"; value bmi 1 = "<18. 5" 2 = "18. 5 -<25" 3 = "25 -<30" 4 = "30+"; value dense 1 = "Entirely Fatty" 2 = "Scattered Fibroglandular" 3 = "Heterogeneously Dense" 4 = "Extremely Dense";
Selecting certain observations data BCSC. current; set BCSC. data 1; if examyear >= 2007;
Summary Statistics by Density ods html style=journal body= 'Z: Contingency tables with density current age group row'; proc freq data=BCSC. current; tables age_group*density_c / nocol nocum chisq; weight N; by imputation_flag; title 'Frequency of Age group by BI-RADS density with row percentages'; format age_group age. density_c dense. ; run; ods html close;
Proc Freq: age*density
Chisq option
Summary Statistics by Density ods html style=journal body= 'Z: Contingency tables with density current bmi row'; proc freq data=BCSC. current; tables bmigrp*density_c / nocol nocum chisq; weight N; by imputation_flag; title 'Frequency of BMI by BI-RADS density with row percentages'; format bmigrp bmi. density_c dense. ; run; ods html close;
Proc Freq: bmi*density
Creating dummy variables /*creating dummy variables for age and restricting data to 2007 -2010*/ data BCSC. current; set BCSC. data 1; if examyear >= 2007; _Imputation_ = imputation_flag; if age_group = 2 then age 47 = 1; else age 47 = 0; if age_group = 3 then age 52 = 1; else age 52 = 0; if age_group = 4 then age 57 = 1; else age 57 = 0; if age_group = 5 then age 62 = 1; else age 62 = 0;
Logistic Ordinal Regression /*Running logit ordinal regression for age*/ proc genmod data=BCSC. current rorder=internal; freq N; model density_c = age 47 age 52 age 57 age 62 age 67 age 72 age 77 age 82 age 87 / Cov. B dist=multinomial link=cumlogit type 1; by _Imputation_; ods output Cov. B = BCSC. age. Cov. B; ods output Parameter. Estimates = BCSC. age. PE; title 'Predicting density from age group Logit'; format density_c dense. ; run;
Aligning Parameter names /*renaming variable levels to run proc mianalyze*/ data BCSC. age. PE; set BCSC. age. PE; if parameter = 'age 47' then parameter = if parameter = 'age 52' then parameter = if parameter = 'age 57' then parameter = if parameter = 'age 62' then parameter = if parameter = 'age 67' then parameter = if parameter = 'age 72' then parameter = if parameter = 'age 77' then parameter = if parameter = 'age 82' then parameter = if parameter = 'age 87' then parameter = 'prm 1'; 'prm 2'; 'prm 3'; 'prm 4'; 'prm 5'; 'prm 6'; 'prm 7'; 'prm 8'; 'prm 9';
Proc Mianalyze /*Combining the imputations for the Logit regression*/ ods html style=journal body= 'Z: Age parameter estimatesOrdinal logit'; proc mianalyze parms=BCSC. age. PE cov. B=BCSC. age. Cov. B mult; modeleffects Intercept 1 Intercept 2 Intercept 3 prm 1 prm 2 prm 3 prm 4 prm 5 prm 6 prm 7 prm 8 prm 9; title 'Treating age as ordinal using logit regression'; run; ods html close;
- Slides: 20