OPTIONS LINESIZE=80;
TITLE1 'Factorial Design of Influencing Factor ';
TITLE2 'For breaking stength of synthetic fiber';
TITLE3 'Factor A (MACHINE) : 4 Levels of Machines (random) 1, 2, 3, 4 ';
TITLE4 'Factor B (OPERATOR) : 3 Levels of Operators (random) x, y, z';
DATA FIBER;
/* @@ means a loop in reading input variable sequence */
INPUT MACHINE OPERATOR $ STRENGTH @@;
CARDS;
1 X 109 1 X 110
1 Y 110 1 Y 112
1 Z 116 1 Z 114
2 X 110 2 X 115
2 Y 110 2 Y 111
2 Z 112 2 Z 115
3 X 108 3 X 109
3 Y 111 3 Y 109
3 Z 114 3 Z 119
4 X 110 4 X 108
4 Y 114 4 Y 112
4 Z 120 4 Z 117
;
RUN;
/* Print the original data set */
PROC PRINT;
RUN;
/* Create Table & tabulate input data set */
/* Nicety, but not absolutely necessary for */
/* the analysis - you may skip */
PROC TABULATE;
CLASS MACHINE OPERATOR ;
VAR STRENGTH;
TABLE OPERATOR, MACHINE*STRENGTH/CONDENSE;
KEYLABEL SUM='Y(IJ)';
RUN;
/* General Linear Model (GLM) */
PROC GLM;
CLASS MACHINE OPERATOR;
MODEL STRENGTH = MACHINE OPERATOR MACHINE*OPERATOR;
/* RANDOM - Specify which effects in the model */
/* are random */
/* Q - Calc. all quadratic forms in the fixed */
/* effects that appear in the expected */
/* mean squares */
RANDOM MACHINE OPERATOR/Q;
OUTPUT OUT = A3 P = YHAT R = RESID;
RUN;
PROC PLOT DATA = A3;
PLOT YHAT*MACHINE = OPERATOR/HAXIS = 0 TO 5 BY 1;
PLOT RESID*YHAT;
RUN;
/* Compute Normal Scores of input data, 'A3' */
/* using cum. normal function/Residual */
/* BLOM -> yi = þ-1(ri -3/8)/(n+1/4) */
/* ri = rank of the ith obs */
PROC RANK DATA = A3 NORMAL = BLOM OUT = NPLOT3;
VAR RESID;
RANKS NSCORE;
RUN;
PROC PLOT DATA = NPLOT3;
PLOT NSCORE*RESID;
RUN;
|