faces | Faces display of multivariate data | faces |
The display is organized into one or more rectangular "blocks" per page; each block may have any number of rows and columns.
Note: The program generates a very large data set to draw the faces, approximately 800 annotate observations for each face. Disk usage depends on the number of faces plotted per page, which is the product of the parameters BLKS * ROWS * COLS. The RES option controls the number of plotting observations for each face.
The FACEKEY macro creates a legend for a faces display showing the assignment of variables to facial features.
Each parameter normally ranges from 0 to 1. It is the user's responsibility to scale the data appropriately before calling FACES. (See the scale macro for this.). Alternatively, the option STD=RANGE may now be used to perform this scaling internally.
Parameter | Facial Feature |
---|---|
1 (EYSI) | Eye size |
2 (PUSI) | Pupil size |
3 (POPU) | Position of pupil |
4 (EYSL) | Eye slant |
5 (HPEY) | Horizontal position of eye |
6 (VPEY) | Vertical position of eye |
7 (CUEB) | Curvature of eyebrow |
8 (DEEB) | Density of eyebrow |
9 (HPEB) | Horizontal position of eyebrow |
10 (VPEB) | Vertical position of eyebrow |
11 (UPHA) | Upper hair line |
12 (LOHA) | Lower hair line |
13 (FALI) | Face line |
14 (DAHA) | Darkness of hair |
15 (HSSL) | Hair shading slant angle |
16 (NOSE) | Nose line |
17 (SIMO) | Size of mouth |
18 (CUMO) | Curvature of mouth |
The arguments may be listed within parentheses in any order, separated by commas. For example:
%faces(left=variables, right=variables, ..., )
%include macros(faces); *-- or include in an autocall library; %include macros(scale) ; %include data(autom) ; goptions vsize=7.5 hsize=7.5in lfactor=4; title h=1.8 "Faces Plot of Automobile data"; data autom; length clr $8; set autom; if rep77 ^= . and rep78 ^=.; /* delete missing data */ if rep78 =. then rep78=rep77; price = -price; /* change signs so that large */ turn = -turn; /* values represent 'good' cars*/ gratio= -gratio; weight=-weight; length=-length; select; when (origin ='A') clr = 'RED'; when (origin ='E') clr = 'GREEN'; when (origin ='J') clr = 'BLUE'; otherwise clr='BLACK'; end; %scale(data=autom, out=scaled, outstat=range, var = gratio turn rep77 rep78 price mpg hroom rseat trunk weight length displa, copy=clr _freq_, id=id); data scaled; set scaled; where id in ('Average', 'American', 'European', 'Japanese'); run;The faces macro is called as follows. Note that although there are only 4 faces, to display them in one row, without distortion, the ROWS parameter is set to 4.
%faces(data=scaled, id=id, idnum=_freq_, color=clr, res=3, blks=1, rows=4, cols=4, l1 =mpg, r1 =mpg, l2 =mpg, r2 =mpg, l3 =turn, r3 =turn, l4 =turn, r4 =turn, l5 =hroom, r5 =hroom, l6 =hroom, r6 =hroom, l7 =rseat, r7 =trunk, l8 =rseat, r8 =trunk, l9 =displa, r9 =displa, l10=length, r10=length, l11=rep77, r11=rep78, l12=weight, r12=weight, l13=weight, r13=weight, l14=rep77, r14=rep78, l15=gratio, r15=gratio, l16=length, r16=length, l17=price, r17=price, l18=price, r18=price);This assignment of features could also be specified as
left=mpg mpg turn turn hroom hroom rseat rseat displa length rep77 weight weight rep77 gratio length price price, right=mpg mpg turn turn hroom hroom rseat rseat displa length rep78 weight weight rep78 gratio length price price,The following figure is produced:
The following example creates a data set with 4 observations corresponding to the combinations of minimum (0), maximum (1) and average values on all varibles, and displays them in a faces plot.
data minmax; input nr r1-r18 #2 l1-l18 numid $char16.; r=int(nr/10); c=mod(nr,10); cards; 11 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. All MIN values 13 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. All MAX values 31 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 .5 All AVG values 33 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. Min(L) Max (R) ; title h=1.6 'Minimum and Maximum Parameters for Asymmetric Faces'; %faces(data=minmax, id=numid, hcolor='GREEN', blks=1,rows=2,cols=2, left =l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 l18, right=r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 );The following figure is produced: