Advertisement
Guest User

TP0

a guest
Aug 14th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 3.86 KB | None | 0 0
  1. LIBNAME LIBRARY 'D:\Users\AdelinouxX\Desktop\Travail_SAS\FORMAT';
  2. LIBNAME OUT 'D:\Users\AdelinouxX\Desktop\Travail_SAS\DATA';
  3.  
  4. data out.reglog;
  5.     set out.datalabel;
  6.     keep happy3 health3 sclact2 lknemny3 sblwcoa3 hincfel2 sclmeet2;
  7. run;
  8.  
  9. ods pdf file = 'D:\Users\AdelinouxX\Desktop\Travail_SAS\FORMAT\RESULTS\reglog_1expcat.pdf';
  10. option nodate;
  11. title1 'La r?gression logistique avec une explicative cat?gorielle';
  12.  
  13. title2 "Analyse descriptive pr?alable : Table de contingence";
  14.  
  15. proc freq data = out.reglog;
  16.     tables health3*happy3/out = out.health_eval;
  17. run;
  18.  
  19. proc logistic data = out.health_eval;  
  20.     class health3 (ref = 'A) Bonne santé')/param=ref;
  21.     weight count;
  22.     model happy3(event= 'B) Moyennement heureux') = health3/expb clodds = WALD;
  23. run;  
  24.  
  25. proc freq data = out.reglog;
  26.     tables sclact2*happy3/out = out.sclact_eval;
  27. run;
  28.  
  29. proc logistic data = out.sclact_eval;  
  30.     class sclact2 (ref = 'B) Beaucoup')/param=ref;
  31.     weight count;
  32.     model happy3(event= 'B) Moyennement heureux') = sclact2/expb clodds = WALD;
  33. run;  
  34.  
  35. proc freq data = out.reglog;
  36.     tables lknemny3*happy3/out = out.lknemny_eval;
  37. run;
  38.  
  39. proc logistic data = out.lknemny_eval;  
  40.     class lknemny3 (ref = 'B) Plutôt pas')/param=ref;
  41.     weight count;
  42.     model happy3(event= 'B) Moyennement heureux') = lknemny3/expb clodds = WALD;
  43. run;  
  44.  
  45. proc freq data = out.reglog;
  46.     tables sblwcoa3*happy3/out = out.sblwcoa_eval;
  47. run;
  48.  
  49. proc logistic data = out.sblwcoa_eval;  
  50.     class sblwcoa3 (ref = 'A) Oui')/param=ref;
  51.     weight count;
  52.     model happy3(event= 'B) Moyennement heureux') = sblwcoa3/expb clodds = WALD;
  53. run;  
  54.  
  55. proc freq data = out.reglog;
  56.     tables hincfel2*happy3/out = out.hincfel_eval;
  57. run;
  58.  
  59. proc logistic data = out.hincfel_eval;  
  60.     class hincfel2 (ref = 'A) Confortable')/param=ref;
  61.     weight count;
  62.     model happy3(event= 'B) Moyennement heureux') = hincfel2/expb clodds = WALD;
  63. run;  
  64.  
  65. proc freq data = out.reglog;
  66.     tables sclmeet2*happy3/out = out.sclmeet_eval;
  67. run;
  68.  
  69. proc logistic data = out.sclmeet_eval;  
  70.     class sclmeet2 (ref = 'B) Beaucoup')/param=ref;
  71.     weight count;
  72.     model happy3(event= 'B) Moyennement heureux') = sclmeet2/expb clodds = WALD;
  73. run;  
  74.  
  75. title;
  76. ods pdf close;
  77.  
  78. /* DEUX EXPLICATIVES CATEGORIELLES */
  79.  
  80. ods pdf file = 'D:\Users\AdelinouxX\Desktop\Travail_SAS\RESULTS\reglog_2expcat.pdf';
  81.  
  82. title1 'La r?gression logistique avec deux explicatives cat?gorielles';
  83.  
  84.  
  85. title2 "Evaluation de la d?mocratie en fonction du niveau d'aisance et de la place dans la soci?t?";
  86.  
  87. /* Table de contingence health3*sblwcoa3 */
  88.  
  89. title3 "Table de contingence health3*sblwcoa3";
  90. proc freq data = out.reglog;
  91.     tables health3*sblwcoa3*happy3/nocol nopercent;
  92. run;
  93.  
  94. title3 "Mod?le de r?gression - avec interaction" ;
  95. proc logistic data = out.reglog;
  96.     class health3 (ref = 'A) Bonne santé') sblwcoa3 (ref = 'A) Oui')/param=ref;
  97.     model happy3(event= 'B) Moyennement heureux') = health3 sblwcoa3 health3*sblwcoa3;
  98. run;  
  99.  
  100. /* Table de contingence hincfel2*sblwcoa3 */
  101.  
  102. title3 "Table de contingence hincfel2*sblwcoa3";
  103. proc freq data = out.reglog;
  104.     tables health3*sblwcoa3*happy3/nocol nopercent;
  105. run;
  106.  
  107. title3 "Mod?le de r?gression - avec interaction" ;
  108. proc logistic data = out.reglog;
  109.     class hincfel2 (ref = 'A) Confortable') sblwcoa3 (ref = 'A) Oui')/param=ref;
  110.     model happy3(event= 'B) Moyennement heureux') = hincfel2 sblwcoa3 hincfel2*sblwcoa3;
  111. run;  
  112.  
  113. /* Table de contingence hincfel2*sblwcoa3 */
  114.  
  115. title3 "Table de contingence health3*lknemny3";
  116. proc freq data = out.reglog;
  117.     tables health3*lknemny3*happy3/nocol nopercent;
  118. run;
  119.  
  120. title3 "Mod?le de r?gression - avec interaction" ;
  121. proc logistic data = out.reglog;
  122.     class health3 (ref = 'A) Bonne santé') lknemny3 (ref = 'B) Plutôt pas')/param=ref;
  123.     model happy3(event= 'B) Moyennement heureux') = health3 lknemny3 health3*lknemny3;
  124. run;  
  125.  
  126. title;
  127. ods pdf close;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement