| 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. On some operating systems it is necessary to acquire temporary disk space before running the program. Disk usage depends on the number of faces plotted per page, which is the product of the parameters BLKS * ROWS * COLS.
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 scale.)
| 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 ftext=hwps1011 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: