1 *** S_G.sas from old ST210G; 2 3 filename s_glst 'c:\sasjobs\stat210\jl2003\s_glst.pdf'; 4 ods printer pdf file=s_glst; NOTE: Writing ODS PRINTER output to DISK destination "c:\sasjobs\stat210\jl2003\s_glst.pdf", printer "PDF". 5 6 options formdlim='-'; 7 8 TITLE1 'ANALYSIS OF MULTIPLE 2 X 2 TABLES USING LOGISTIC REGRESSION'; 9 10 DATA ONE; 11 INPUT K N1 D1 N2 D2; 12 CARDS; NOTE: The data set WORK.ONE has 3 observations and 5 variables. NOTE: DATA statement used: real time 0.05 seconds 16 *****; 17 PROC PRINT; 18 NOTE: There were 3 observations read from the data set WORK.ONE. NOTE: PROCEDURE PRINT used: real time 0.44 seconds 19 DATA TWO; SET ONE; 20 KEEP I J K F; 21 D3=N1-D1; 22 D4=N2-D2; 23 I = 1; J = 1; F =D1; OUTPUT; 24 I = 2; J = 1; F =D2; OUTPUT; 25 I = 1; J = 2; F =D3; OUTPUT; 26 I = 2; J = 2; F =D4; OUTPUT; 27 NOTE: There were 3 observations read from the data set WORK.ONE. NOTE: The data set WORK.TWO has 12 observations and 4 variables. NOTE: DATA statement used: real time 0.00 seconds 28 PROC FREQ; TABLE K*I*J / CMH NOPRINT; 29 WEIGHT F; 30 TITLE3 'ESTIMATES AND TESTS OF GROUP X RESPONSE COMBINED OVER STRATA --' 31 ' PARTIAL, ADJUSTED ANALYSES'; 32 NOTE: There were 12 observations read from the data set WORK.TWO. NOTE: PROCEDURE FREQ used: real time 0.32 seconds 33 DATA FOUR; SET ONE; 34 KEEP k GROUP S2 S3 GS2 GS3 F N; 35 S2 = 0; IF K = 2 THEN S2 = 1; 36 S3 = 0; IF K = 3 THEN S3 = 1; 37 GROUP = 1; N = N1; F =D1; 38 GS2=group*s2; gs3=group*s3; 39 OUTPUT; 40 GROUP = 0; N = N2; F =D2; 41 GS2=group*s2; gs3=group*s3; 42 OUTPUT; NOTE: There were 3 observations read from the data set WORK.ONE. NOTE: The data set WORK.FOUR has 6 observations and 8 variables. NOTE: DATA statement used: real time 0.00 seconds 43 PROC PRINT; 44 NOTE: There were 6 observations read from the data set WORK.FOUR. NOTE: PROCEDURE PRINT used: real time 0.05 seconds 45 PROC LOGISTIC descending; 46 MODEL F/N = GROUP S2 S3 / RL; 47 test s2=s3=0; 48 TITLE2 'MAXIMUM LIKELIHOOD ANALYSIS THROUGH LOGISTIC REGRESSION'; 49 title3 'model with binary dummy variables'; 50 NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: There were 6 observations read from the data set WORK.FOUR. NOTE: PROCEDURE LOGISTIC used: real time 0.27 seconds 51 proc logistic descending; 52 class group k; 53 model f/n = group k / rl; 54 title3 'model with class effects'; 55 NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: There were 6 observations read from the data set WORK.FOUR. NOTE: PROCEDURE LOGISTIC used: real time 0.16 seconds 56 proc genmod descending; 57 class group k; 58 model f/n = group k / link=logit dist=bin type3; 59 title3 'GENMOD model with class effects'; 60 61 run; NOTE: The DESCENDING option applies only to the multinomial distribution with ordinal response. NOTE: Algorithm converged. NOTE: The scale parameter was held fixed. NOTE: PROCEDURE GENMOD used: real time 0.11 seconds 62 63 proc logistic descending; 64 model f/n = group s2 s3 gs2 gs3 / rl; 65 test gs2=gs3=0; 66 title2 'model with interactions and test of homogeneity'; 67 title3 'model with binary dummy variables'; 68 NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: There were 6 observations read from the data set WORK.FOUR. NOTE: PROCEDURE LOGISTIC used: real time 0.26 seconds 69 proc logistic descending; 70 class group k; 71 model f/n = group k group*k / rl; 72 title3 'model with class effects'; 73 NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: There were 6 observations read from the data set WORK.FOUR. NOTE: PROCEDURE LOGISTIC used: real time 0.22 seconds 74 proc genmod descending; 75 model f/n = group s2 s3 gs2 gs3 / link=logit dist=bin type3; 76 *test gs2=gs3=0; 77 title3 'GENMOD model with no class effects'; 78 NOTE: The DESCENDING option applies only to the multinomial distribution with ordinal response. NOTE: Fitting saturated model. Scale will not be estimated. NOTE: Algorithm converged. NOTE: The scale parameter was held fixed. NOTE: PROCEDURE GENMOD used: real time 0.22 seconds 79 proc genmod descending; 80 class group k; 81 model f/n = group k group*k / link=logit dist=bin type3; 82 title3 'GENMOD model with class effects'; 83 84 RUN; NOTE: The DESCENDING option applies only to the multinomial distribution with ordinal response. NOTE: Fitting saturated model. Scale will not be estimated. NOTE: Algorithm converged. NOTE: The scale parameter was held fixed. NOTE: PROCEDURE GENMOD used: real time 0.10 seconds 85 86 ods printer close; NOTE: ODS PRINTER printed 19 pages to c:\sasjobs\stat210\jl2003\s_glst.pdf. 87 88 run;