SAS Program to solve Exercise 2.13
/* Exercise 2.13, page 118.
Lean body mass is thought to influence metabolic rate.
This program produces a scatter plot of metabolic rate (explanatory) vs.
lean body mass (response). The plot uses a different plotting symbol
for men (red squares) and women (black circles).
Results:
There is clearly a positive linear relationship between the two variables.
This is true for both genders. For the most part, men have both higher
lean body mass values and higher metabolic rate values. Although there
are too few male observations, it would appear that the variation in male
metabolic rate is larger than it is for females.
*/
data metabolic;
input subject sex $ mass rate;
datalines;
1 M 62.0 1792
2 M 62.9 1666
3 F 36.1 995
4 F 54.6 1425
5 F 48.5 1396
6 F 42.0 1418
7 M 47.4 1362
8 F 50.6 1502
9 F 42.0 1256
10 M 48.7 1614
11 F 40.3 1189
12 F 33.1 913
13 M 51.9 1460
14 F 42.4 1124
15 F 34.5 1052
16 F 51.1 1347
17 F 41.2 1204
18 M 51.9 1867
19 M 46.9 1439
;
symbol1 value=circle color=black;
symbol2 value=square color=red;
proc gplot data=metabolic;
title 'Metabolic Rate vs Lean Body Mass (by Gender)';
plot rate*mass=sex;
run;
G. Andrus, 2006