Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Tri de la table mmse_result par patient et numéro de visite */
- /* SORTSEQ + numeric_collation : permet le tri de la colonne visdesc */
- PROC SORT DATA = Source.mmse_result OUT = SOurce.mmse_result_ordered SORTSEQ=linguistic (numeric_collation=on);
- BY USUBJID VISID;
- RUN ;
- /* 2.4.1 */
- PROC SORT DATA = Source.mmse_result OUT = source.tableTriee ;
- BY USUBJID VISID ;
- RUN ;
- PROC TRANSPOSE DATA = Source.tableTriee OUT = Source.qst ;
- BY USUBJID VISID;
- VAR MMSED1 MMSED2 MMSED3 MMSED5 MMSED6 MMSED7 MMSED8 MMSED9 MMSED10 MMSED11 MMSED12 ;
- RUN ;
- PROC TRANSPOSE DATA = Source.tableTransposee OUT = Source.score PREFIX=Score ;
- BY USUBJID VISID ;
- VAR MMSES1 MMSES2 MMSES3 MMSES5 MMSES6 MMSES7 MMSES8 MMSES9 MMSES10 MMSES11 MMSES12;
- RUN ;
- DATA Source.FIN ;
- MERGE Source.qst Source.score ;
- BY USUBJID VISID ;
- RUN ;
- PROC PRINT DATA=SOurce.fin LABEL NOOBS;
- /*2.4.2*/
- /* Transposition des scores par visites */
- PROC TRANSPOSE DATA=Source.mmse_result_ordered OUT=Source.mmse_transposed_visit_answer(DROP=_name_ _label_) PREFIX=Visite_ ;
- BY usubjid;
- VAR MMSES1-MMSES3 MMSES5-MMSES12;
- ID visid;
- RUN;
- /* Fusion des deux tables */
- /* On réexploite la table transposée des questions */
- DATA Source.mmse_merged_2412; /* 2412 référence le # de question */
- MERGE Source.fin(IN=mark1) Source.mmse_transposed_visit_answer(IN=mark2);
- BY usubjid;
- IF mark1 THEN OUTPUT;
- RUN;
- /* Affichage de la table de résultat */
- /* missing : remplace les valeures nulles */
- Option missing="";
- DATA Source.mmse_q LABEL;
- SET Source.mmse_merged_2412;
- DROP visid;
- ATTRIB usubjid
- LABEL = "N° du patient";
- ATTRIB Q1
- LABEL = "Question";
- RUN;
- PROC PRINT DATA=Source.mmse_q NOOBS LABEL;
- TITLE "MMSE - Scores par visite d'une question, groupés par patient";
- RUN;
- /* 2.4.3 */
- PROC SORT DATA= Source.mmse_result OUT=source.int;
- BY USUBJID VISID;
- RUN;
- PROC TRANSPOSE DATA = Source.int OUT = Source.deux PREFIX=sco ;
- BY USUBJID VISID;
- VAR MMSES1 MMSES2 MMSES3 MMSES5 MMSES6 MMSES7 MMSES8 MMSES9 MMSES10 MMSES11 MMSES12;
- RUN;
- proc sort data=Source.deux;
- by USUBJID VISID;
- run;
- data Source.MMSE_ScoreInt(keep=USUBJID VISID score);
- set Source.deux;
- retain score;
- by USUBJID VISID;
- if first.VISID then score=sco1;
- else score=score+sco1;
- if last.VISID;
- run;
- DATA Source.groupesT;
- SET Source.treatment_assignment(Keep=USUBJID TRTCD);
- RUN;
- DATA Source.groupesT2;
- SET Source.groupesT;
- Attrib numGroupe LABEL="Numéro de groupe en Numérique";
- numGroupe = input(TRTCD,20.6);
- numGroupe=TRTCD;
- RUN;
- PROC PRINT DATA=Source.groupesT2 LABEL NOOBS;
- PROC SQL ;
- create table Source.MMSE_Score as
- select a.*, b.*
- from Source.MMSE_ScoreInt as a left join Source.groupesT2 as b on a.USUBJID=b.USUBJID
- ORDER BY USUBJID, VISID;
- QUIT ;
- PROC PRINT DATA=Source.MMSE_Score LABEL NOOBS;
- /*2.4.4*/
- PROC CORR DATA=Source.MMSE_Score KENDALL;
- /*Proche de 0, donc il y a une corrélation*/
- RUN;
- /*2.4.5*/
- VAR score numGroupe;PROC SQL ;
- create table Source.MMSE_freq as
- Select score
- from Source.MMSE_Score
- where VISID = (Select min(VISID)
- From Source.MMSE_Score)
- GROUP BY USUBJID
- QUIT;
- PROC PRINT DATA=Source.MMSE_freq LABEL NOOBS;
- data Source.MMSE_freq ;
- set Source.MMSE_SCORE;
- by USUBJID;
- if first.USUBJID or last.USUBJID;
- run;
- PROC PRINT DATA=Source.MMSE_freq LABEL NOOBS;
- /*2.4.6*/
- PROC TRANSPOSE DATA = Source.MMSE_freq OUT = Source.SixFin ;
- BY USUBJID ;
- VAR score ;
- RUN ;
- PROC PRINT DATA=Source.SixFin LABEL NOOBS;
- proc freq data=Source.SixFin;
- table COL1*COL2/ norow nocol;
- ;
- run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement