options ls=80; data cash; input y age $ gender $ rep; cards; 21.0 1 1 1 23.0 1 1 2 19.0 1 1 3 22.0 1 1 4 22.0 1 1 5 23.0 1 1 6 21.0 1 2 1 22.0 1 2 2 20.0 1 2 3 21.0 1 2 4 19.0 1 2 5 25.0 1 2 6 30.0 2 1 1 29.0 2 1 2 26.0 2 1 3 28.0 2 1 4 27.0 2 1 5 27.0 2 1 6 26.0 2 2 1 29.0 2 2 2 27.0 2 2 3 28.0 2 2 4 27.0 2 2 5 29.0 2 2 6 25.0 3 1 1 22.0 3 1 2 23.0 3 1 3 21.0 3 1 4 22.0 3 1 5 21.0 3 1 6 23.0 3 2 1 19.0 3 2 2 20.0 3 2 3 21.0 3 2 4 20.0 3 2 5 20.0 3 2 6 ; proc glm data=cash; class age gender; model y=age gender age*gender; output out=new r=resid; proc sort data=new; by age gender; proc means data=new; by age gender;