/* The dataset has the formats below permanently assigned to certain variables.
We do NOT need to rerun the DATA step used to assign the formats however
we DO need to resubmit the PROC FORMAT so SAS will know the translations used */
PROC FORMAT;
VALUE GDR 1 = "Male"
2 = "Female";
VALUE YN 1 = "Yes"
2 = "No";
VALUE EXER 1 = "High"
2 = "Moderate"
3 = "Low";
VALUE TREAT 1 = "Ran"
2 = "Sat";
VALUE BMI_TWO 1 = "< 25"
2 = "25+";
VALUE BMI_FOUR 1 = "< 18.5"
2 = "[18.5, 25)"
3 = "[25, 30)"
4 = "30+";
VALUE WT_TWO 1 = "87kg or Below"
2 = "More than 87kg";
VALUE WT_FOUR 1 = "55kg or Below "
2 = "(55kg, 60kg]"
3 = "(60kg, 67kg]"
4 = "(67kg, 79kg]"
5 = "More than 79kg";
RUN;
/* Numeric Summaries of DIFFERENCES by TRT */
/* We add the CLM option for confidence intervals for the mean in each group */
PROC MEANS DATA = BIO.PULSE_STEP6 N MEAN STD CLM;
CLASS TRT;
VAR DIFF_2V1;
RUN;
PROC MEANS DATA = BIO.PULSE_STEP6 MIN Q1 MEDIAN Q3 MAX;
CLASS TRT;
VAR DIFF_2V1;
RUN;
/* QQ-plots for DIFFERENCES for each TRT */
/* WHERE statement allows you to select a portion of the observations
based upon the condition specified - here we look at TRT = 1 */
PROC UNIVARIATE DATA = BIO.PULSE_STEP6 NOPRINT;
WHERE TRT=1;
QQPLOT DIFF_2V1 / NORMAL(MU=EST SIGMA=EST);
RUN;
/* Here we use TRT = 2 in the WHERE statement*/
PROC UNIVARIATE DATA = BIO.PULSE_STEP6 NOPRINT;
WHERE TRT=2;
QQPLOT DIFF_2V1 / NORMAL(MU=EST SIGMA=EST);
RUN;
/* Side-by-Side Boxplots */
PROC SGPLOT DATA=BIO.PULSE_STEP6;
VBOX DIFF_2V1 / CATEGORY = TRT;
RUN;
/* Here you might also want the individual boxplots */
/* The WHERE statement can again accomplish this task */
TITLE "TREATMENT = RAN";
PROC SGPLOT DATA=BIO.PULSE_STEP6;
WHERE TRT=1;
VBOX DIFF_2V1 ;
RUN;
TITLE; /* CLEAR THE TITLE! */
TITLE "TREATMENT = SAT";
PROC SGPLOT DATA=BIO.PULSE_STEP6;
WHERE TRT=2;
VBOX DIFF_2V1 ;
RUN;
TITLE; /* CLEAR THE TITLE! */