Advertisement
Guest User

Untitled

a guest
Dec 1st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 16.14 KB | None | 0 0
  1. libname SOURCE  "/folders/myFolders/Miniprojet/source";    /* endroit où se trouvent tous les datasets sources et les formats */
  2. options fmtsearch=( SOURCE  WORK);
  3. options ls=256;
  4. /*1 : Import des données*/
  5. proc contents data=source.demography short;
  6. proc contents data=source.physical_exam short;
  7. proc contents data=source.vital_signs short;
  8. proc contents data=source.treatment_assignment short;
  9. run;
  10. /*------------------------------------------------------2.1----------------------------------------------------------*/
  11.  
  12. /* 2.1.1 : Age Today*/
  13. DATA source.DM;
  14.     TITLE "Demography w/ current age";
  15.     SET source.demography;
  16.     ATTRIB AGE_TODAY LABEL="Age today" LENGTH=3;
  17.     AGE_TODAY=year(today()) - birthdtyy;
  18. run;
  19.  
  20. /* 2.1.2 : Fusion DM et Treatment_assignment*/
  21. DATA source.DM;
  22. TITLE "Demography merged w/ treatment";
  23. MERGE source.dm source.treatment_assignment;
  24. BY USUBJID;
  25. RUN;
  26.  
  27.  
  28. /* 2.1.3 : Age moyen max et min pour chaque groupe de traitement*/
  29. PROC MEANS DATA=source.DM VAR MAX MIN NONOBS
  30. MAXDEC=2;
  31. VAR age;
  32. CLASS trtcd;
  33. ;
  34. title "Age statistics by treatment grp";
  35. /*-----------------------------------------------2.2------------------------------------------------------------*/
  36.  
  37. /*2.2.1*/
  38. DATA source.TAILLE;
  39. SET SOURCE.PHYSICAL_EXAM;
  40. WHERE HGT is not null;
  41. KEEP USUBJID HGT;
  42. RUN;
  43.  
  44.  
  45. /*On récupere le poids et l'id de la visite correspondante*/
  46.  
  47. DATA source.POIDS;
  48. SET SOURCE.PHYSICAL_EXAM;
  49. WHERE WGT is not null;
  50. KEEP USUBJID WGT WGTU VISID;
  51. RUN;
  52.  
  53. /*Récupération des dates des visites*/
  54.  
  55. DATA source.DATE;
  56. SET SOURCE.DATE_OF_VISIT;
  57. KEEP USUBJID VISID VISDT;
  58. RUN;
  59.  
  60. /*Tri par USUBJID pour la fusion des 3 tables*/
  61.  
  62. PROC SORT DATA=source.TAILLE;
  63. BY USUBJID;
  64. RUN;
  65.  
  66. PROC SORT DATA=source.POIDS;
  67. BY USUBJID VISID;
  68. RUN;
  69.  
  70. PROC SORT DATA=source.DATE;
  71. BY USUBJID VISID;
  72. RUN;
  73.  
  74. /*Fusion du poids et de la date de visite*/
  75.  
  76. DATA source.imc;
  77. MERGE source.POIDS (IN=mark1) source.DATE (IN=mark2);
  78. BY USUBJID VISID;
  79. if mark1 and mark2 then output;
  80. RUN;
  81.  
  82. /*Fusion de la taille et de la table imc*/
  83.  
  84. DATA source.imc;
  85. MERGE source.TAILLE source.imc;
  86. BY USUBJID;
  87. RUN;
  88.  
  89. /*Tri pour avoir la dernière visite en premier*/
  90.  
  91. PROC SORT DATA=source.imc;
  92. BY USUBJID DESCENDING VISDT;
  93. RUN;
  94.  
  95.  
  96.  
  97.  
  98. /*Supprime les doublons pour garder seulement la dernière visite de chaque individu*/
  99.  
  100. PROC SORT DATA=source.imc nodupkey;
  101. BY USUBJID;
  102. RUN;
  103.  
  104.  
  105. /* creer un nouveau dataset ou il y a l'imc calcule*/
  106. DATA source.CalculImc;
  107. SET source.imc;
  108. ATTRIB imc
  109.     LABEL="IMC"
  110.     LENGTH=3
  111.     ;
  112.     imc= (WGT/((HGT/100)*(HGT/100)));
  113. RUN;
  114.  
  115. /*2.2.2*/
  116.  
  117. /*fusion de physical exam et de la date de visite*/
  118.  
  119. DATA source.Physicalvisit;
  120. MERGE source.physical_exam (IN=mark1) source.DATE (IN=mark2);
  121. BY USUBJID VISID;
  122. if mark1 and mark2 then output;
  123. RUN;
  124.  
  125. /*fusion de physicalvisit avec dm pour avoir le dataset PE*/
  126. DATA source.PE;
  127. MERGE source.physicalvisit source.dm;
  128. BY USUBJID;
  129. RUN;
  130.  
  131. /*2.2.3*/
  132.  
  133. /*On fusionne pour que les groupes de traitements et les imc soient dans la meme table*/
  134. DATA source.IMC_moyen;
  135. MERGE source.calculimc source.treatment_assignment;
  136. BY USUBJID;
  137. RUN;
  138.  
  139. /*on cherche donc l'imc moyen pour chaque groupe de traitement*/
  140. PROC MEANS DATA=source.IMC_moyen
  141.     MEDIAN STDDEV
  142.         MAXDEC=3;
  143.     VAR imc;
  144.     CLASS TRTDESC;
  145. RUN;
  146.  
  147. /*représentation graphique de l'IMC pour les différents groupes de traitement*/
  148. PROC SGPLOT DATA=source.imc_moyen;
  149. VBAR TRTDESC / RESPONSE= imc STAT=MEAN;
  150. TITLE 'Graphique de l IMC par groupes';
  151. RUN;
  152.  
  153. /*2.2.4*/
  154. /*a) On définit Ho pour qui l'imc calculé depend du traitement avec le mentalor 50mg, le mentalor 120mg et le placebo
  155.  
  156. Il faut vérifier la variable continue, pour chaque groupe, suit une distribution normal et il faut aussi vérifier
  157. l'égalité des variances.
  158.  
  159. */
  160.  
  161. ODS GRAPHICS ON;
  162. PROC ANOVA DATA=SOURCE.imc_moyen;
  163. CLASS TRTDESC;
  164. MODEL imc = TRTDESC;
  165. TITLE"Hypothèses: les IMC sont égales";
  166. RUN;
  167.  
  168. /*P > 0.05 donc l'hypothèse est rejetée, l'imc ne dépend pas du groupe de traitement*/
  169.  
  170.  
  171. /*2.2.5*/
  172.  
  173. /*On crée un nouveau dataset qui contient l'imc et le sex*/
  174. DATA source.PEimc;
  175. MERGE source.imc_moyen source.dm;
  176. BY USUBJID;
  177. RUN;
  178.  
  179. /*tri par sex et par groupe de traitement*/
  180. PROC SORT data=source.peimc;
  181. by TRTCD SEX;
  182. run;
  183.  
  184. /*Analyse des valeurs numériques par sexe */
  185. proc means data=source.peimc maxdec=2;
  186.       var age wgt hgt imc;
  187.       CLASS sex;
  188. run;
  189.  
  190. /*On remarque grâce a ces resultats qu'en moyenne, quelque soit le groupe, le poids, la taille, l'imc sont superieur pour les hommes a celle des femmes.
  191.          Pour ce qui est des autres variables on voit que l'age des femmes  est superieur a celui des hommes */
  192.  
  193.  
  194.  
  195. /*représentation graphique des valeurs numériques pour les différents groupes de traitement*/
  196. PROC SGPLOT DATA=source.peimc;
  197. VBAR TRTDESC / RESPONSE= age STAT=MEAN;
  198. TITLE 'Graphique de l age par groupes de traitement';
  199. RUN;
  200.  
  201. PROC SGPLOT DATA=source.peimc;
  202. VBAR TRTDESC / RESPONSE= wgt STAT=MEAN;
  203. TITLE 'Graphique du poids par groupes de traitement';
  204. RUN;
  205.  
  206. PROC SGPLOT DATA=source.peimc;
  207. VBAR TRTDESC / RESPONSE= hgt STAT=MEAN;
  208. TITLE 'Graphiquede la taille par groupes de traitement';
  209. RUN;
  210.  
  211. PROC SGPLOT DATA=source.peimc;
  212. VBAR TRTDESC / RESPONSE= imc STAT=MEAN;
  213. TITLE 'Graphique de l imc par groupes de traitement';
  214. RUN;
  215.  
  216. /*-----------------------------------------------2.3------------------------------------------------------------*/
  217.  
  218. /*2.3.1 : Tension et 2.3.2 : Diagnostic*/
  219. DATA source.Tension;
  220. TITLE "Tension";
  221. SET source.vital_signs;
  222. ATTRIB tension label="Diagnostique tension" LENGTH=$40;
  223. IF SYS > 180 OR DIA > 110 THEN
  224. tension = "Hypertension sévère";
  225. ELSE IF SYS > 159 OR DIA > 99 THEN
  226. tension = "Hypertension modérée";
  227. ELSE IF SYS > 139 OR DIA > 89 THEN
  228. tension = "Hypertension légère";
  229. ELSE IF SYS > 129 OR DIA > 84 THEN
  230. tension = "Tension normale élevée";
  231. ELSE IF SYS > 119 OR DIA > 79 THEN
  232. tension = "Tension normale";
  233. ELSE tension = "Tension optimale";
  234. run;
  235.  
  236. /*2.3.3 : Fusion avec Date_of_visit*/
  237. DATA source.VS;
  238. TITLE "Tension merged w/ Date_of_visit";
  239. MERGE source.Tension source.Date_of_visit;
  240. BY USUBJID;
  241. IF SYS=. OR DIA =. THEN tension = "Non calculé";
  242. run;
  243. /*PROC PRINT DATA=source.Tension LABEL NOOBS;
  244. run;*/
  245.  
  246. /*2.3.4 : Fusion VS et PE*/
  247. PROC SORT data=source.PE;
  248. BY USUBJID;
  249. run;
  250. PROC SORT data=source.VS;
  251. BY USUBJID;
  252. run;
  253. DATA source.VS_PE;
  254. TITLE "VS merged w/ PE";
  255. MERGE source.VS source.PE;
  256. BY USUBJID;
  257. run;
  258.  
  259. /*2.3.5 : Fréquence paramètres*/
  260. PROC SORT DATA=source.vs_pe OUT = source.vs_pe;
  261. BY TRTCD;
  262. run;
  263. PROC FREQ DATA=source.vs_pe ORDER=freq;
  264. TABLES SYS*TEMP / LIST NOCUM OUT=source.sys_avg_by_trtmntgrp;
  265. BY TRTCD;
  266. run;
  267.  
  268.  
  269. /*2.3.6 : Égalité moyenne tension systolique */
  270. PROC ANOVA DATA=source.vs_pe;
  271. CLASS TRTCD;
  272. MODEL SYS = TRTCD;
  273. run;
  274.  
  275. PROC FREQ DATA=source.vs_pe;
  276. TABLE SYS / chisq;
  277. run;
  278.  
  279. /*-----------------------------------------------2.4------------------------------------------------------------*/
  280.  
  281. /* Tri de la table mmse_result par patient et numéro de visite */
  282. /* SORTSEQ + numeric_collation : permet le tri de la colonne visdesc */
  283. PROC SORT DATA = Source.mmse_result OUT = SOurce.mmse_result_ordered SORTSEQ=linguistic (numeric_collation=on);
  284.   BY USUBJID VISID;
  285. RUN ;
  286.  
  287. /* 2.4.1 */
  288.  
  289. PROC SORT DATA = Source.mmse_result OUT = source.tableTriee ;
  290.   BY USUBJID VISID ;
  291. RUN ;
  292. PROC TRANSPOSE DATA = Source.tableTriee OUT = Source.qst ;
  293.   BY USUBJID VISID;
  294.   VAR MMSED1 MMSED2 MMSED3 MMSED5 MMSED6 MMSED7 MMSED8 MMSED9 MMSED10 MMSED11 MMSED12 ;
  295. RUN ;
  296. PROC TRANSPOSE DATA = Source.tableTriee OUT = Source.score PREFIX=Score ;
  297.   BY USUBJID VISID ;
  298.   VAR  MMSES1 MMSES2 MMSES3 MMSES5 MMSES6 MMSES7 MMSES8 MMSES9 MMSES10 MMSES11 MMSES12;
  299. RUN ;
  300. DATA Source.FIN ;
  301.   MERGE Source.qst Source.score ;
  302.   BY USUBJID VISID ;
  303. RUN ;
  304.  
  305. /*2.4.2*/
  306.  
  307. /* Transposition des scores par visites */
  308. PROC TRANSPOSE DATA=Source.mmse_result_ordered OUT=Source.mmse_transposed_visit_answer(DROP=_name_ _label_) PREFIX=Visite_ ;
  309.     BY usubjid;
  310.     VAR MMSES1-MMSES3 MMSES5-MMSES12;
  311.     ID visid;
  312. RUN;
  313.  
  314. /* Fusion des deux tables */
  315. /* On réexploite la table transposée des questions */
  316. DATA Source.mmse_merged_2412; /* 2412 référence le # de question */
  317. MERGE Source.fin(IN=mark1) Source.mmse_transposed_visit_answer(IN=mark2);
  318. BY usubjid;
  319. IF mark1 THEN OUTPUT;
  320. RUN;
  321.  
  322. /* Affichage de la table de résultat */
  323. /* missing : remplace les valeures nulles */
  324. Option missing="";
  325. DATA Source.mmse_q LABEL;
  326. SET Source.mmse_merged_2412;
  327. DROP visid;
  328. ATTRIB usubjid
  329.     LABEL = "N° du patient";
  330. ATTRIB Q1
  331.     LABEL = "Question";
  332. RUN;
  333.  
  334.  
  335.  
  336.  
  337. /* 2.4.3 */
  338.  
  339. PROC SORT DATA= Source.mmse_result OUT=source.int;
  340.     BY USUBJID VISID;
  341. RUN;
  342. PROC TRANSPOSE DATA = Source.int OUT = Source.deux PREFIX=sco ;
  343.     BY USUBJID VISID;
  344.     VAR  MMSES1 MMSES2 MMSES3 MMSES5 MMSES6 MMSES7 MMSES8 MMSES9 MMSES10 MMSES11 MMSES12;
  345. RUN;
  346.  
  347. proc sort data=Source.deux;
  348. by USUBJID VISID;
  349. run;
  350.  
  351. data Source.MMSE_ScoreInt(keep=USUBJID VISID score);
  352. set Source.deux;
  353. retain score;
  354. by USUBJID VISID;
  355. if first.VISID then score=sco1;
  356. else score=score+sco1;
  357. if last.VISID;
  358. run;
  359.  
  360.  
  361. DATA Source.groupesT;
  362. SET Source.treatment_assignment(Keep=USUBJID TRTCD);
  363. RUN;
  364.  
  365. DATA Source.groupesT2;
  366. SET Source.groupesT;
  367. Attrib numGroupe LABEL="Numéro de groupe en Numérique";
  368.     numGroupe = input(TRTCD,20.6);
  369.     numGroupe=TRTCD;
  370. RUN;
  371.  
  372.  
  373. PROC SQL ;
  374. create table Source.MMSE_Score as
  375. select a.*, b.*
  376. from Source.MMSE_ScoreInt as a left join Source.groupesT2 as b on a.USUBJID=b.USUBJID
  377. ORDER BY USUBJID, VISID;
  378. QUIT ;
  379.  
  380.  
  381. /*2.4.4*/
  382.  
  383. PROC CORR DATA=Source.MMSE_Score KENDALL;
  384.    
  385. /*Proche de 0, donc il y a une corrélation*/
  386.  
  387. RUN;
  388.  
  389.  
  390. /*2.4.5*/
  391.  
  392. /*VAR  score numGroupe;*/
  393. PROC SQL ;
  394.  
  395. create table Source.MMSE_freq  as
  396. Select score
  397. from Source.MMSE_Score
  398. where VISID = (Select min(VISID)
  399.                 From Source.MMSE_Score)
  400. GROUP BY USUBJID;
  401. QUIT;
  402.  
  403.  
  404. data Source.MMSE_freq ;
  405. set Source.MMSE_SCORE;
  406. by USUBJID;
  407. if first.USUBJID or last.USUBJID;
  408. run;
  409.  
  410.  
  411. /*2.4.6*/
  412.  
  413.  
  414. PROC TRANSPOSE DATA = Source.MMSE_freq OUT = Source.SixFin ;
  415.   BY USUBJID ;
  416.   VAR score ;
  417. RUN ;
  418.  
  419.  
  420. proc freq data=Source.SixFin;
  421.    table COL1*COL2/ norow nocol;
  422.  ;
  423.  
  424. run;
  425.  
  426.  
  427. /*-----------------------------------------------2.5------------------------------------------------------------*/
  428.  
  429. /*Question 2.5.1 : création d'un dataset adverse_event2, copie d'adverse-event
  430. avec les dates complétés de début et fin de chaque événement indésirable */
  431. data SOURCE.adverse_event2;
  432. SET SOURCE.adverse_event;
  433. ATTRIB ae_start_date
  434.     LABEL="DATE début"
  435.     Format=nldate.;
  436. ATTRIB ae_end_date
  437.     LABEL="DATE fin"
  438.     Format=nldate.;
  439. ae_start_date = aestdt;
  440. ae_end_date = AEENDT;
  441.  
  442. if AESTDTMO = 'JAN' then
  443. num_month = 01;
  444. else if AESTDTMO = 'FEB' then
  445. num_month = 02;
  446. else if AESTDTMO = 'MAR' then
  447. num_month = 03;
  448. else if AESTDTMO = 'APR' then
  449. num_month = 04;
  450. else if AESTDTMO = 'MAI' then
  451. num_month = 05;
  452. else if AESTDTMO = 'JUN' then
  453. num_month = 06;
  454. else if AESTDTMO = 'JUL' then
  455. num_month = 07;
  456. else if AESTDTMO = 'AUG' then
  457. num_month = 08;
  458. else if AESTDTMO = 'SEP' then
  459. num_month = 09;
  460. else if AESTDTMO = 'OCT' then
  461. num_month = 10;
  462. else if AESTDTMO = 'NOV' then
  463. num_month = 11;
  464. else if AESTDTMO = 'DEC' then
  465. num_month = 12;
  466.  
  467. if AESTDTDD = ' ' && AESTDTMO = ' '  then   /* jour et mois vide pour date début*/
  468. ae_start_date = mdy(01,01,AESTDTYY); /* mois/jour/année */
  469. else if AESTDTDD = ' ' then     /* si seulement le jour est vide */
  470. ae_start_date = mdy(num_month,01,AESTDTYY);
  471. else if AESTDTMO = ' ' then     /*si seulement le mois est vide*/
  472. ae_start_date = mdy(01,AESTDTDD,AESTDTYY);
  473.  
  474.  
  475. if AEENDTMO = 'JAN' then
  476. num_month_fin = 01;
  477. else if AEENDTMO = 'FEB' then
  478. num_month_fin = 02;
  479. else if AEENDTMO = 'MAR' then
  480. num_month_fin = 03;
  481. else if AEENDTMO = 'APR' then
  482. num_month_fin = 04;
  483. else if AEENDTMO = 'MAI' then
  484. num_month_fin = 05;
  485. else if AEENDTMO = 'JUN' then
  486. num_month_fin = 06;
  487. else if AEENDTMO = 'JUL' then
  488. num_month_fin = 07;
  489. else if AEENDTMO = 'AUG' then
  490. num_month_fin = 08;
  491. else if AEENDTMO = 'SEP' then
  492. num_month_fin = 09;
  493. else if AEENDTMO = 'OCT' then
  494. num_month_fin = 10;
  495. else if AEENDTMO = 'NOV' then
  496. num_month_fin = 11;
  497. else if AEENDTMO = 'DEC' then
  498. num_month_fin = 12;
  499.  
  500. /*Pour avoir le dernier jour du mois */
  501. aeendtc1= cats(AEENDTYY,'-',num_month_fin);
  502. aeendtc2=input(aeendtc1,anydtdte7.);
  503. lastDay=intnx ('month',aeendtc2,0,'E');
  504.  
  505. if AEENDTDD = ' ' && AEENDTMO = ' '  then   /* jour et mois vide pour date fin*/
  506. ae_end_date = mdy(12,31,AEENDTYY);
  507. else if AEENDTDD = ' ' then     /* si seulement le jour est vide */
  508. ae_end_date = lastDay;
  509. else if AEENDTMO = ' ' then     /*si seulement le mois est vide*/
  510. ae_end_date = mdy(12,AEENDTDD,AEENDTYY);
  511.  
  512. RUN;
  513.  
  514. /*Question 2.5.2 : on enlève les varibles "intermédiaires" utilisées
  515. pour la question 2.5.1*/
  516. data SOURCE.adverse_event2(drop = num_month num_month_fin aeendtc1 aeendtc2 lastDay);
  517. set SOURCE.adverse_event2;
  518. RUN;
  519.  
  520. /* Question 2.5.2 : fusion entre le dataset AE et treatment_assignment, pour avoir le groupe
  521. de traitement*/
  522. data source.AE;
  523. merge source.adverse_event2 (IN=mark1) source.treatment_assignment(keep=TRTCD ASGNDTTM USUBJID IN=mark2);
  524. by USUBJID;
  525. if mark1 then output;
  526. RUN;
  527.  
  528. /* Question 2.5.2 : récupération de la dernière visite pour chaque patient
  529. dans un nouveau dataset "lastvisit"*/
  530. proc sql undo_policy=none;
  531.    create table source.lastVisit as
  532.    select USUBJID, max(VISDT) as VISDT format=nldate.
  533.    from source.date_of_visit
  534.    group by USUBJID;
  535. quit;
  536.  
  537. /*Question 2.5.2 :fusion entre les deux datasets pour avoir la date
  538. de dernière visite dans le dataset AE*/
  539. data source.AE;
  540. merge source.AE(IN=mark1) source.lastVisit(IN=mark2);
  541. by USUBJID;
  542. if mark1 then output;
  543. RUN;
  544.  
  545. /*Questions 2.5.3 : séparation des données en 3 tableaux difdérents suivant le groupe de traitement*/
  546. data source.AE1;
  547. set source.AE (WHERE=(TRTCD="1"));
  548. RUN;
  549.  
  550. data source.AE2;
  551. set source.AE (WHERE=(TRTCD="2"));
  552. RUN;
  553.  
  554. data source.AE3;
  555. set source.AE (WHERE=(TRTCD="3"));
  556. RUN;
  557.  
  558.  
  559. /*Questions 2.5.3 + 2.5.4 : création et affichage des graphiques pour chaque groupe de traitement*/
  560. title "AE de chaque patient en fonction du temps du groupe de traitement 1";
  561. proc sgplot data=source.AE1 ;
  562.    highlow y=USUBJID low=ae_start_date high=ae_end_date /
  563.            group=AESEV
  564.            type=bar
  565.            barwidth=0.4;
  566.    yaxis label="Patient ID";
  567.    xaxis label="Time" min= '01jan05'd;
  568.    scatter x=ae_start_date y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=trianglefilled color=blue);
  569.    scatter x=VISDT y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=circlefilled color=green);
  570. run;
  571.  
  572. title "AE de chaque patient en fonction du temps du groupe de traitement 2";
  573. proc sgplot data=source.AE2 ;
  574.    highlow y=USUBJID low=ae_start_date high=ae_end_date /
  575.            group=AESEV
  576.            type=bar
  577.            barwidth=0.4;
  578.    yaxis label="Patient ID";
  579.    xaxis label="Time" min= '01jan05'd;
  580.    scatter x=ae_start_date y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=trianglefilled color=blue);
  581.    scatter x=VISDT y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=circlefilled color=green);
  582. run;
  583.  
  584. title "AE de chaque patient en fonction du temps du groupe de traitement 3";
  585. proc sgplot data=source.AE3 ;
  586.    highlow y=USUBJID low=ae_start_date high=ae_end_date /
  587.            group=AESEV
  588.            type=bar
  589.            barwidth=0.4;
  590.    yaxis label="Patient ID";
  591.    xaxis label="Time" min= '01jan05'd;
  592.    scatter x=ae_start_date y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=trianglefilled color=blue);
  593.    scatter x=VISDT y=USUBJID / markerattrs=graphdatadefault(size=6px symbol=circlefilled color=green);
  594. run;
  595.  
  596. /*Question 2.5.5* : récupération du nombre de chaque soccode pour chaque groupe de traitement*/
  597. proc sql undo_policy=none;
  598.    create table source.freqsoc as
  599.    select TRTCD, SOCCODE, count(SOCCODE) as frequence
  600.    from source.AE
  601.    group by SOCCODE, TRTCD
  602.    order by TRTCD;
  603. quit;
  604.  
  605. /*Question 2.5.5 : graphique représentant la proportion des soc termes en fonctions du groupe de traitement*/
  606. title "Proportions des « SOC termes » en fonction du groupe traitement";
  607. proc sgplot data=source.freqsoc;
  608.    vbar TRTCD / group=SOCCODE response=frequence seglabel seglabelattrs=(size=12);
  609. run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement