* ch23ta01.sas, example, page 954; * Unbalanced 2x3 factorial experiment; options ls=76; ; data bones; input y A B; lines; 1.4 1 1 1 2.4 1 1 2 2.2 1 1 3 2.1 1 2 1 1.7 1 2 2 0.7 1 3 1 1.1 1 3 2 2.4 2 1 1 2.5 2 2 1 1.8 2 2 2 2.0 2 2 3 0.5 2 3 1 0.9 2 3 2 1.3 2 3 3 ; proc glm; class A B; model y = A B A*B; means A*B; *** "means A B" would give misinformation for main effects; lsmeans A B A*B / pdiff=all cl adjust=Tukey alpha=0.05; estimate 'A2-A1' A -1 1; estimate 'B1-B2' B 1 -1 0; estimate 'B1-B3' B 1 0 -1; estimate 'B2-B3' B 0 1 -1; output out=stats p=yhat r=e; title 'Chapter 23 example: Growth hormone example, page 954'; ; proc glm; class A B; model y = B A A*B; title2 '(Enter main effects in the other order.)'; ; proc plot; plot yhat*A=B yhat*B=A / vpos=18; title2; ; * generate residual plots; proc rank normal=Blom; var e; ranks nscore; proc plot; plot e*yhat / vpos=22 vref=0; plot e*nscore / vpos=22 vref=0 href=0; Chapter 23 example: Growth hormone example, page 954 1 The GLM Procedure Class Level Information Class Levels Values A 2 1 2 B 3 1 2 3 Number of observations 14 Chapter 23 example: Growth hormone example, page 954 2 The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 5 4.47428571 0.89485714 5.51 0.0172 Error 8 1.30000000 0.16250000 Corrected Total 13 5.77428571 R-Square Coeff Var Root MSE y Mean 0.774864 24.53731 0.403113 1.642857 Source DF Type I SS Mean Square F Value Pr > F A 1 0.00285714 0.00285714 0.02 0.8978 B 2 4.39600000 2.19800000 13.53 0.0027 A*B 2 0.07542857 0.03771429 0.23 0.7980 Source DF Type III SS Mean Square F Value Pr > F A 1 0.12000000 0.12000000 0.74 0.4152 B 2 4.18971429 2.09485714 12.89 0.0031 A*B 2 0.07542857 0.03771429 0.23 0.7980 Chapter 23 example: Growth hormone example, page 954 3 The GLM Procedure Level of Level of --------------y-------------- A B N Mean Std Dev 1 1 3 2.00000000 0.52915026 1 2 2 1.90000000 0.28284271 1 3 2 0.90000000 0.28284271 2 1 1 2.40000000 . 2 2 3 2.10000000 0.36055513 2 3 3 0.90000000 0.40000000 Chapter 23 example: Growth hormone example, page 954 4 The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Tukey-Kramer H0:LSMean1= LSMean2 A y LSMEAN Pr > |t| 1 1.60000000 0.4152 2 1.80000000 A y LSMEAN 95% Confidence Limits 1 1.600000 1.242204 1.957796 2 1.800000 1.399972 2.200028 Least Squares Means for Effect A Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 -0.200000 -0.736688 0.336688 Chapter 23 example: Growth hormone example, page 954 5 The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Tukey-Kramer LSMEAN B y LSMEAN Number 1 2.20000000 1 2 2.00000000 2 3 0.90000000 3 Least Squares Means for effect B Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: y i/j 1 2 3 1 0.7845 0.0059 2 0.7845 0.0072 3 0.0059 0.0072 B y LSMEAN 95% Confidence Limits 1 2.200000 1.663307 2.736693 2 2.000000 1.575707 2.424293 3 0.900000 0.475707 1.324293 Least Squares Means for Effect B Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 0.200000 -0.647749 1.047749 1 3 1.300000 0.452251 2.147749 2 3 1.100000 0.356475 1.843525 Chapter 23 example: Growth hormone example, page 954 6 The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Tukey-Kramer LSMEAN A B y LSMEAN Number 1 1 2.00000000 1 1 2 1.90000000 2 1 3 0.90000000 3 2 1 2.40000000 4 2 2 2.10000000 5 2 3 0.90000000 6 Least Squares Means for effect A*B Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: y i/j 1 2 3 4 5 6 1 0.9997 0.1211 0.9464 0.9995 0.0757 2 0.9997 0.2347 0.9013 0.9923 0.1732 3 0.1211 0.2347 0.1135 0.0843 1.0000 4 0.9464 0.9013 0.1135 0.9836 0.0888 5 0.9995 0.9923 0.0843 0.9836 0.0505 6 0.0757 0.1732 1.0000 0.0888 0.0505 A B y LSMEAN 95% Confidence Limits 1 1 2.000000 1.463307 2.536693 1 2 1.900000 1.242688 2.557312 1 3 0.900000 0.242688 1.557312 2 1 2.400000 1.470420 3.329580 2 2 2.100000 1.563307 2.636693 2 3 0.900000 0.363307 1.436693 Least Squares Means for Effect A*B Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 0.100000 -1.244555 1.444555 1 3 1.100000 -0.244555 2.444555 1 4 -0.400000 -2.100742 1.300742 1 5 -0.100000 -1.302606 1.102606 1 6 1.100000 -0.102606 2.302606 2 3 1.000000 -0.472886 2.472886 2 4 -0.500000 -2.303910 1.303910 2 5 -0.200000 -1.544555 1.144555 2 6 1.000000 -0.344555 2.344555 3 4 -1.500000 -3.303910 0.303910 3 5 -1.200000 -2.544555 0.144555 Chapter 23 example: Growth hormone example, page 954 7 The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Tukey-Kramer Least Squares Means for Effect A*B Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 3 6 -2.22045E-16 -1.344555 1.344555 4 5 0.300000 -1.400742 2.000742 4 6 1.500000 -0.200742 3.200742 5 6 1.200000 -0.002606 2.402606 Chapter 23 example: Growth hormone example, page 954 8 The GLM Procedure Dependent Variable: y Standard Parameter Estimate Error t Value Pr > |t| A2-A1 0.20000000 0.23273733 0.86 0.4152 B1-B2 0.20000000 0.29668305 0.67 0.5192 B1-B3 1.30000000 0.29668305 4.38 0.0023 B2-B3 1.10000000 0.26020825 4.23 0.0029 Chapter 23 example: Growth hormone example, page 954 9 Chapter 23 example: Growth hormone example, page 954 10 (Enter main effects in the other order.) The GLM Procedure Dependent Variable: y Source DF Type I SS Mean Square F Value Pr > F B 2 4.30628571 2.15314286 13.25 0.0029 A 1 0.09257143 0.09257143 0.57 0.4720 A*B 2 0.07542857 0.03771429 0.23 0.7980 Chapter 23 example: Growth hormone example, page 954 11 Plot of yhat*A. Symbol is value of B. yhat | 2.4 + 1 2.3 + 2.2 + 2.1 + 2 2.0 + 1 1.9 + 2 1.8 + 1.7 + 1.6 + 1.5 + 1.4 + 1.3 + 1.2 + 1.1 + 1.0 + 0.9 + 3 3 | ---+----------------------------------------------+-- 1 2 A NOTE: 8 obs hidden. Chapter 23 example: Growth hormone example, page 954 12 Plot of yhat*B. Symbol is value of A. yhat | 2.4 +2 2.3 + 2.2 + 2.1 + 2 2.0 +1 1.9 + 1 1.8 + 1.7 + 1.6 + 1.5 + 1.4 + 1.3 + 1.2 + 1.1 + 1.0 + 0.9 + 1 | -+---------------------------------+---------------------------------+- 1 2 3 B NOTE: 9 obs hidden. Chapter 23 example: Growth hormone example, page 954 13 Plot of e*yhat. Legend: A = 1 obs, B = 2 obs, etc. e | 0.4 + A A A | 0.3 + | 0.2 + A A A | 0.1 + | 0.0 +--A-----------------------------------------------------------A-- | -0.1 + A | -0.2 + A A | -0.3 + A | -0.4 + A | -0.5 + | -0.6 + A ---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 yhat Chapter 23 example: Growth hormone example, page 954 14 Plot of e*nscore. Legend: A = 1 obs, B = 2 obs, etc. e | | 0.4 + | A B | | 0.3 + | | | 0.2 + | A B | | 0.1 + | | | 0.0 +-----------------------------A+A----------------------------- | | -0.1 + A | | | -0.2 + A A | | | -0.3 + A | | | -0.4 + A | | | -0.5 + | | | -0.6 + A | ---+-------------+-------------+-------------+-------------+-- -2 -1 0 1 2 Rank for Variable e