LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 1 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 SEE Dgaussdiscrim.sas FOR VIEWS OF THE SAME DATASET THE DATA AS SAS SEES IT Subj y1 y2 y3 y4 Type 1 57 66 18 34 1 2 45 95 60 75 1 3 36 91 68 66 1 4 33 97 45 93 1 5 54 75 39 49 1 6 45 83 47 65 1 7 52 84 45 57 1 8 40 74 42 72 1 9 51 96 35 64 1 10 49 89 51 72 1 11 63 82 34 66 1 12 48 100 28 57 1 13 52 99 28 72 1 14 52 84 41 95 1 15 52 61 32 79 2 16 25 64 33 97 2 17 27 59 56 113 2 18 47 64 41 108 2 19 68 89 55 75 2 20 37 79 36 83 2 21 46 55 54 71 2 22 47 48 31 61 2 23 37 50 36 65 2 24 34 67 56 66 2 25 33 82 50 93 2 26 30 67 41 95 2 27 67 111 44 93 2 28 51 62 44 72 2 29 61 72 43 101 2 30 30 49 54 81 2 31 31 80 43 86 2 32 47 73 50 80 2 33 40 65 51 78 2 34 36 88 36 90 2 35 35 73 47 87 2 36 44 56 41 57 2 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 2 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y1-Y4 The LOGISTIC Procedure Model Information Data Set WORK.FERNS Response Variable Type Number of Response Levels 2 Model binary logit Optimization Technique Fisher's scoring Number of Observations Read 36 Number of Observations Used 36 Response Profile Ordered Total Value Type Frequency 1 1 14 2 2 22 Probability modeled is Type=1. Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. Model Fit Statistics Intercept Intercept and Criterion Only Covariates AIC 50.114 28.806 SC 51.697 36.724 -2 Log L 48.114 18.806 Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 29.3076 4 <.0001 Score 19.7594 4 0.0006 Wald 7.7146 4 0.1026 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 3 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y1-Y4 The LOGISTIC Procedure Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 5.1945 6.3734 0.6643 0.4151 y1 1 -0.0843 0.0639 1.7405 0.1871 y2 1 0.1996 0.0748 7.1204 0.0076 y3 1 -0.0680 0.0792 0.7365 0.3908 y4 1 -0.1944 0.0835 5.4256 0.0198 Odds Ratio Estimates Point 95% Wald Effect Estimate Confidence Limits y1 0.919 0.811 1.042 y2 1.221 1.054 1.414 y3 0.934 0.800 1.091 y4 0.823 0.699 0.970 Association of Predicted Probabilities and Observed Responses Percent Concordant 95.1 Somers' D 0.906 Percent Discordant 4.5 Gamma 0.909 Percent Tied 0.3 Tau-a 0.443 Pairs 308 c 0.953 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 4 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y1-Y4 OUTEST DATASET: THE FULL OUTEST DATASET Obs _LINK_ _TYPE_ _STATUS_ _NAME_ Intercept y1 1 LOGIT PARMS 0 Converged Type 5.19448 -0.084329 Obs y2 y3 y4 _LNLIKE_ 1 0.19958 -0.067960 -0.19440 -9.40315 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 5 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y1-Y4 OUTEST DATASET: THE INTERESTING VARIABLES: _NAME_ _TYPE_ Intercept y1 y2 y3 y4 Type PARMS 5.19448 -0.084329 0.19958 -0.067960 -0.19440 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 6 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 NOW ENTERING PROC IML Fern Data and (true) classification XX TYPE 1 57 66 18 34 1 1 45 95 60 75 1 1 36 91 68 66 1 1 33 97 45 93 1 1 54 75 39 49 1 1 45 83 47 65 1 1 52 84 45 57 1 1 40 74 42 72 1 1 51 96 35 64 1 1 49 89 51 72 1 1 63 82 34 66 1 1 48 100 28 57 1 1 52 99 28 72 1 1 52 84 41 95 1 1 52 61 32 79 2 1 25 64 33 97 2 1 27 59 56 113 2 1 47 64 41 108 2 1 68 89 55 75 2 1 37 79 36 83 2 1 46 55 54 71 2 1 47 48 31 61 2 1 37 50 36 65 2 1 34 67 56 66 2 1 33 82 50 93 2 1 30 67 41 95 2 1 67 111 44 93 2 1 51 62 44 72 2 1 61 72 43 101 2 1 30 49 54 81 2 1 31 80 43 86 2 1 47 73 50 80 2 1 40 65 51 78 2 1 36 88 36 90 2 1 35 73 47 87 2 1 44 56 41 57 2 The regression coefficients (Beta) are BETA 5.1945 -0.0843 0.1996 -0.0680 -0.1944 These should be the same as in the Proc Logistic output. NOW DOING the Resubstitution Analysis: RESUBSTITUTION ANALYSIS for logistic regression: TYPE is the original type - CTYPE is the inferred type LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 7 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 NOW ENTERING PROC IML PREX1 is Logistic Prob(TYPE=1|X) SUBJ YDOT TYPE PREX1 CTYPE ERRX100 1 5.7272 1 0.9968 1 0 2 1.7024 1 0.8458 1 0 3 2.8689 1 0.9463 1 0 4 0.6338 1 0.6533 1 0 5 3.4333 1 0.9687 1 0 6 2.1349 1 0.8942 1 0 7 3.4353 1 0.9688 1 0 8 -0.2607 1 0.4352 2 800 9 5.2334 1 0.9947 1 0 10 1.3624 1 0.7962 1 0 11 1.1065 1 0.7515 1 0 12 8.1212 1 0.9997 1 0 13 4.6683 1 0.9907 1 0 14 -3.6800 1 0.0246 2 1400 15 -4.5483 2 0.0105 2 0 16 -5.2398 2 0.0053 2 0 17 -11.0797 2 0.0000 2 0 18 -9.7770 2 0.0001 2 0 19 -1.0948 2 0.2507 2 0 20 -0.7404 2 0.3229 2 0 21 -5.1798 2 0.0056 2 0 22 -3.1541 2 0.0409 2 0 23 -3.0290 2 0.0461 2 0 24 -0.9368 2 0.2815 2 0 25 -2.6997 2 0.0630 2 0 26 -5.2176 2 0.0054 2 0 27 0.6287 2 0.6522 1 2700 28 -3.7191 2 0.0237 2 0 29 -8.1362 2 0.0003 2 0 30 -6.9719 2 0.0009 2 0 31 -1.0937 2 0.2509 2 0 32 -3.1494 2 0.0411 2 0 33 -3.8349 2 0.0211 2 0 34 -0.2206 2 0.4451 2 0 35 -3.2943 2 0.0358 2 0 36 -1.2065 2 0.2303 2 0 ERRSUM Number of misclassifications: 3 Classification of test data: MSUBJ MDAT MDOT MPREX1 MTYPE 1 34 99 15 50 11.3464 1.0000 1 2 45 70 49 86 -4.6779 0.0092 2 3 50 82 51 104 -6.3396 0.0018 2 4 46 119 43 79 6.7857 0.9989 1 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 8 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 A PLOT FOR Y2 Vs Y4: `MOREDAT' POINTS HAVE SYMBOL=3 Plot of y2*y4. Symbol is value of Type. y2 ‚ 120 ˆ 3 ‚ ‚ ‚ 2 ‚ ‚ ‚ 100 ˆ 3 1 1 ‚ 1 1 ‚ 1 ‚ 1 ‚ 1 2 2 ‚ ‚ 1 11 2 1 3 80 ˆ 2 2 ‚ ‚ 1 1 2 2 ‚ 3 2 ‚ ‚ 1 2 2 2 ‚ 2 2 2 60 ˆ 2 2 ‚ 2 ‚ 2 ‚ 2 ‚ 2 2 ‚ ‚ 40 ˆ Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒ 20 40 60 80 100 120 y4 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 9 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y2 and Y4 ONLY The LOGISTIC Procedure Model Information Data Set WORK.FERNS Response Variable Type Number of Response Levels 2 Model binary logit Optimization Technique Fisher's scoring Number of Observations Read 36 Number of Observations Used 36 Response Profile Ordered Total Value Type Frequency 1 1 14 2 2 22 Probability modeled is Type=1. Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied. Model Fit Statistics Intercept Intercept and Criterion Only Covariates AIC 50.114 27.273 SC 51.697 32.023 -2 Log L 48.114 21.273 Testing Global Null Hypothesis: BETA=0 Test Chi-Square DF Pr > ChiSq Likelihood Ratio 26.8412 2 <.0001 Score 19.4634 2 <.0001 Wald 10.6173 2 0.0049 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 10 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y2 and Y4 ONLY The LOGISTIC Procedure Analysis of Maximum Likelihood Estimates Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 -1.3017 3.7551 0.1202 0.7289 y2 1 0.1402 0.0464 9.1126 0.0025 y4 1 -0.1358 0.0516 6.9179 0.0085 Odds Ratio Estimates Point 95% Wald Effect Estimate Confidence Limits y2 1.151 1.050 1.260 y4 0.873 0.789 0.966 Association of Predicted Probabilities and Observed Responses Percent Concordant 94.5 Somers' D 0.893 Percent Discordant 5.2 Gamma 0.896 Percent Tied 0.3 Tau-a 0.437 Pairs 308 c 0.946 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 11 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 LOGISTIC REGRESSION FOR Y2 and Y4 ONLY OUTEST DATASET (Y2 Y4): REGRESSIONS COEFFICIENTS: _NAME_ _TYPE_ Intercept y2 y4 Type PARMS -1.30170 0.14020 -0.13580 LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 12 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 NOW ENTERING PROC IML (REGRESSION ON Y2 Y4 ONLY) Fern Data and (true) classification XX TYPE 1 66 34 1 1 95 75 1 1 91 66 1 1 97 93 1 1 75 49 1 1 83 65 1 1 84 57 1 1 74 72 1 1 96 64 1 1 89 72 1 1 82 66 1 1 100 57 1 1 99 72 1 1 84 95 1 1 61 79 2 1 64 97 2 1 59 113 2 1 64 108 2 1 89 75 2 1 79 83 2 1 55 71 2 1 48 61 2 1 50 65 2 1 67 66 2 1 82 93 2 1 67 95 2 1 111 93 2 1 62 72 2 1 72 101 2 1 49 81 2 1 80 86 2 1 73 80 2 1 65 78 2 1 88 90 2 1 73 87 2 1 56 57 2 The regression coefficients (Beta) are BETA -1.3017 0.1402 -0.1358 These should be the same as in the Proc Logistic output. NOW DOING the Resubstitution Analysis: RESUBSTITUTION ANALYSIS for logistic regression: TYPE is the original type - CTYPE is the inferred type LOGISTIC REGRESSION - Two sets of Ferns - YOUR NAME 13 TWO CLASSES with 4 covariates 21:01 Monday, October 27, 2008 NOW ENTERING PROC IML (REGRESSION ON Y2 Y4 ONLY) PREX1 is Logistic Prob(TYPE=1|X) SUBJ YDOT TYPE PREX1 CTYPE ERRX100 1 3.3347 1 0.9656 1 0 2 1.8330 1 0.8621 1 0 3 2.4944 1 0.9237 1 0 4 -0.3309 1 0.4180 2 400 5 2.5596 1 0.9282 1 0 6 1.5085 1 0.8188 1 0 7 2.7351 1 0.9391 1 0 8 -0.7039 1 0.3310 2 800 9 3.4670 1 0.9697 1 0 10 1.3992 1 0.8021 1 0 11 1.2325 1 0.7743 1 0 12 4.9784 1 0.9932 1 0 13 2.8012 1 0.9427 1 0 14 -2.4251 1 0.0813 2 1400 15 -3.4771 2 0.0300 2 0 16 -5.5008 2 0.0041 2 0 17 -8.3745 2 0.0002 2 0 18 -6.9945 2 0.0009 2 0 19 0.9918 2 0.7294 1 1900 20 -1.4966 2 0.1829 2 0 21 -3.2319 2 0.0380 2 0 22 -2.8554 2 0.0544 2 0 23 -3.1182 2 0.0424 2 0 24 -0.8705 2 0.2951 2 0 25 -2.4339 2 0.0806 2 0 26 -4.8086 2 0.0081 2 0 27 1.6320 2 0.8364 1 2700 28 -2.3863 2 0.0842 2 0 29 -4.9223 2 0.0072 2 0 30 -5.4311 2 0.0044 2 0 31 -1.7638 2 0.1463 2 0 32 -1.9304 2 0.1267 2 0 33 -2.7805 2 0.0584 2 0 34 -1.1853 2 0.2341 2 0 35 -2.8810 2 0.0531 2 0 36 -1.1906 2 0.2332 2 0 ERRSUM Number of misclassifications: 5 Classification of test data: MSUBJ MDAT MDOT MPREX1 MTYPE 1 99 50 5.7887 0.9969 1 2 70 86 -3.1658 0.0405 2 3 82 104 -3.9277 0.0193 2 4 119 79 4.6548 0.9906 1