1 * example2.sas 2 * xref: 3 * input: blex.sas 4 * output: 5 * does - Example how to use GEE macro. 6 - The data step generates data at random. Its details 7 are not important. What matters is that it generates 8 variables:y, id, x1-x5. 9 - Notice that x2-x3 are cluster-level covariates, while 10 x4-x5 are observation-level covariates, x1=intercept. 11 - Cluster size 10,000. 12 ***************************************************; 13 filename BLEX "blex.sas"; 14 %include BLEX; 653 * options mprint; 654 ***************************************************; 655 data A; * generate a dataset; 656 k = 100; * # clusters; 657 n = 10000; * cluster size; 658 beta1 = 1; * parameter values; 659 beta2 =-0.5; 660 beta3 = 0; 661 beta4 =-0.5; 662 beta5 = 0.5; 663 sigma = 0.5; 664 seed = 2141994; 665 retain x1 1 ; 666 array x x1-x5; 667 array beta beta1-beta5; 668 do id = 1 to k; * one cluster; 669 e = rannor(seed); 670 x2 = rannor(seed); 2 The SAS System 23:51 Sunday, June 14, 2020 671 x3 = rannor(seed); 672 do j = 1 to n; * one obs.; 673 x4 = rannor(seed); 674 x5 = rannor(seed); 675 lp = e * sigma; * linear predictor; 676 do l=1 to dim(beta); 677 lp=lp+x[l]*beta[l]; 678 end; 679 p = 1/(1+exp(-lp)); 680 y = (ranuni(seed) <= p); 681 output; 682 end; * one obs.; 683 end; * one cluster; 684 keep id y x1 - x5 ; 685 run; NOTE: The data set WORK.A has 1000000 observations and 7 variables. NOTE: DATA statement used (Total process time): real time 0.32 seconds cpu time 0.25 seconds 686 ***************************************************; 687 title2 "A minimal run"; 688 %gee ( 689 data=A, /* required: dataset name */ 690 yvar=y, /* required: response 0/1 */ 691 xvar=x1 x2 x3 x4 x5, /* required: covariates */ 692 id=id ); /* required: cluster id */ NOTE: There were 1000000 observations read from the data set WORK.A. NOTE: The data set WORK.A has 1000000 observations and 7 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.26 seconds cpu time 0.32 seconds NOTE: There were 1000000 observations read from the data set WORK.A. NOTE: The data set WORK._N_ has 100 observations and 1 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.13 seconds cpu time 0.07 seconds NOTE: IML Ready NOTE: Module SIGNON defined. NOTE: Module INFO defined. NOTE: Module PSDINV defined. NOTE: Module GET1C defined. NOTE: Module ACC1C defined. NOTE: Module CHK1 defined. NOTE: Module ADJUST defined. NOTE: Module UPDATE defined. NOTE: Module RHORANGE defined. NOTE: Module GEE4 defined. NOTE: Module GEE3 defined. NOTE: Module GEE2 defined. NOTE: Module GEE1 defined. NOTE: Module GEE defined. NOTE: Module INITBETA defined. NOTE: Module GETDATA defined. NOTE: Module RESULTS1 defined. 3 The SAS System 23:51 Sunday, June 14, 2020 NOTE: Module RESULTS defined. 693 ***************************************************; NOTE: Exiting IML. NOTE: The PROCEDURE IML printed page 1. NOTE: PROCEDURE IML used (Total process time): real time 2.75 seconds cpu time 2.71 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 3.99 seconds cpu time 3.60 seconds 23:51 Sunday, June 14, 2020 1 A minimal run Generalized estimating equations for exchangeably-correlated binary responses (version 2.3) (c) Bahjat Qaqish and Habib Moalem (1994, 1995) Department of Biostatistics CB 7400 Chapel Hill, NC 27599-7400 Data set: A Response: y Covariates: x1 x2 x3 x4 x5 Cluster ID: id Number of observations: 1000000 Number of covariates: 5 Number of clusters: 100 Cluster sizes: from 10000 to 10000 Iteration 3 rho = 0.0480427 is above the valid range and will be set to 0.0454196 Converged, niter = 7 Number of estimable parameters = 5 Estimated intra-cluster correlation = 0.0419424 Summary of estimates and 0.95 confidence intervals: Results using the robust variance estimator: Estimate Robust SE z p-val Odds Ratio CI-lower CI-upper X1 0.8689596 0.0481432 18.049465 0 2.3844289 2.1697255 2.6203782 X2 -0.547285 0.0559594 -9.780033 0 0.5785184 0.5184232 0.6455798 X3 0.065503 0.0451879 1.4495707 0.1471783 1.0676959 0.9772004 1.166572 X4 -0.47664 0.0042428 -112.3413 0 0.6208659 0.6157244 0.6260504 X5 0.4810347 0.0039145 122.88618 0 1.6177473 1.6053831 1.6302068 Results using the naive variance estimator: Estimate Naive SE z p-val Odds Ratio CI-lower CI-upper X1 0.8689596 0.0232655 37.349771 0 2.3844289 2.278142 2.4956747 X2 -0.547285 0.0178847 -30.60078 0 0.5785184 0.5585907 0.599157 X3 0.065503 0.0157841 4.1499354 0.0000333 1.0676959 1.0351711 1.1012427 X4 -0.47664 0.0028532 -167.0557 0 0.6208659 0.6174036 0.6243476 X5 0.4810347 0.0028656 167.86722 0 1.6177473 1.6086869 1.6268588