'Life is after all a recursive summation, indeed     Let's do some Statistics!

Department of Civil and Environmental Engineering
Frank Batten College of Engineering and Technology
Old Dominion University
Norfolk, Virginia 23529-0241, USA
Tel) (757) 683-3753
Fax) (757) 683-5354


	
Return to CEE 700/800 Homepage
CEE 700/800 Access Counter
 
Go back to
SAS Source Page
Nested Factorial Design
SAS Source: FAC_N.SAS

Example

An engineer is studying the dimensional variability a particular component that is produced on three machines. Each machine has two spindles, and four components produced from each spindle are randomly selected. The results [of components' length] are shown below. Analyze these data, assuming that machines and spindles are fixed factors.


Component
Length
Machine
A B C
Spindle 1 Spindle 2 Spindle 1 Spindle 2 Spindle 1 Spindle 2
Component #1 12 8 14 12 14 16
Component #2 9 9 15 10 10 15
Component #3 11 10 13 11 12 15
Component #4 12 8 14 13 11 14

Use following SAS source to analyze above problem. Closely examine comments in the source for specific model options.

SAS Listing


OPTIONS LINESIZE=80;
TITLE1 'Nested Factorial Design  ';
TITLE2 'Factor A (MACHINE) : 3 Machine (A, B, C) fixed  ';
TITLE3 'Factor B (SPINDLE) : 2 Spindle for each machine (1, 2)  fixed';
TITLE4 'Var (COMPNT) : 4 Components from each spindle random  ';
DATA VARIBLTY;
/* @@ means a loop in reading input variable sequence */
INPUT MACHINE $ SPINDLE COMPNT  @@;
CARDS;
A 1 12 A 1  9 A 1 11 A 1 12
A 2  8 A 2  9 A 2 10 A 2  8
B 1 14 B 1 15 B 1 13 B 1 14
B 2 12 B 2 10 B 2 11 B 2 13
C 1 14 C 1 10 C 1 12 C 1 11
C 2 16 C 2 15 C 2 15 C 2 14
;
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 SPINDLE;
     VAR COMPNT;
     LABEL COMPNT = 'COMPONENT (4 REPLICATES)';
     TABLE MACHINE*SPINDLE*COMPNT/CONDENSE;
     KEYLABEL SUM='Y(IJ)';
RUN;

/* General Linear Model (GLM)                    */
PROC GLM;
     CLASS MACHINE SPINDLE;
     MODEL  COMPNT = MACHINE SPINDLE(MACHINE);
     OUTPUT OUT = A2  P = YHAT  R = RESID;
RUN;

PROC PLOT DATA = A2;
     PLOT RESID*YHAT;
RUN;


/* Compute Normal Scores of input data, 'A2'     */
/* using cum. normal function/Residual           */
/* BLOM -> yi = þ-1(ri -3/8)/(n+1/4)              */
/*         ri = rank of the ith obs              */
PROC RANK DATA = A2 NORMAL = BLOM OUT = NPLOT2;
     VAR RESID;
     RANKS NSCORE;
RUN;

PROC PLOT DATA = NPLOT2;
     PLOT NSCORE*RESID;
RUN;

SAS Listing

SAS User Guide (SUG) for Procedures (PROC) used in the Source

SUG GLM procedure
SUG PLOT procedure
SUG PRINT procedure
SUG RANK procedure
SUG TABULATE procedure
Go back to
SAS Source Page

Return to CEE 700/800 Homepage Return to CEE 700/800 Homepage Move to the Top of this page