GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Applying-Data-Science-Using-SAS/Chapter 21.sas at master · Deepak12545/Applying-Data-Science-Using-SAS Expand file tree/ Copy pathChapter 21.sasMore file actions 98 lines (78 loc) · 2.01 KB / Copy pathChapter 21.sasFile metadata and controls98 lines (78 loc) · 2.01 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 *** 21.3 Data; data claims_feature(keep = policyno feature); set claims_nodup; format Feature $40.; *** 1. Gender; if gender = 'M' then Feature = 'Male'; else Feature = 'Female'; output; *** 2. Age; if 0 < Age < 26 then feature = 'Young'; else if 26 <= age <= 55 then feature = 'Middle Age'; else feature = 'Old'; output; *** 3. Density; feature = Density; output; *** 4. Car Type; feature = Car_type; output; *** 5. Car Use; feature = Car_use; output; *** 6. Claim Flag; if clm_flag = 'Yes' then feature = 'Claim'; else feature = 'No Claim'; output; run; *** 21.3.3 Transpose; data class; format PersonID 3.; set sashelp.class; PersonID = _N_; Weight=round(weight,10); Height=round(height,5); run; proc transpose data=class out=class_tp; by PersonID name; var sex age height weight; run; data Key_Value; set class_tp; rename _name_ = Key; Value = strip(col1); drop col1; Feature = catx('=',_name_,Value); run; *** 21.4.3; /***************************************************************************************** *** This code only runs inside a SAS Code Node in SAS Enterprise Miner !!! ***************************************************************************************** proc sql noprint; select count(distinct(%EM_ID)) into :transN from &EM_IMPORT_TRANSACTION; quit; data work.ChiSquare; set &EM_IMPORT_RULES; CHISQ = .; PVALUE = .; if NOT (CONF=SUPPORT or LIFT=CONF) then do; CHISQ = (&transN * (LIFT-1)**2)*((SUPPORT/100) * (CONF/100)) /((CONF/100 - SUPPORT/100) * (LIFT - CONF/100)); PVALUE = 1-Probchi(CHISQ,1); end; run; proc sql; create table AssocRuleTable_Claims as select Index, Rule, _lhand, _rhand, count, support, exp_conf, conf, lift, pvalue format = 8.4 from ChiSquare; quit; *****************************************************************************************/ |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |