* ch25eg.sas, random-effects one-way ANOVA, data from table 25.1; options ls=78 nodate; ; data Apex; input y officer; lines; 76 1 1 65 1 2 85 1 3 74 1 4 59 2 1 75 2 2 81 2 3 67 2 4 49 3 1 63 3 2 61 3 3 46 3 4 74 4 1 71 4 2 85 4 3 89 4 4 66 5 1 84 5 2 80 5 3 79 5 4 ; * procedures using Ordinary Least Squares (OLS) as if fixed effects; proc glm; class officer; model y = officer; random officer; * causes printing of expected mean squares; title 'Example using Table 25.1 data, page 1036.'; title2 'Using OLS as if fixed effects.'; ; * Variance Components procedure; proc varcomp method=type1; * for estimates as from proc glm; class officer; model y = officer; title2 '("method=type1" => varcomp estimates as from proc glm.)'; ; * procedure using Restricted Maximum Likelihood estimation (ReML); proc mixed CL AsyCov; class officer; model y = ; random officer; ODS exclude FitStatistics; * don't print fit statistics; title2 '("CL" => Satterthwaite-type confidence limits.)'; title3 '("AsyCov" =>asymptotic covars for varcomps to get z.)'; Example using Table 25.1 data, page 1036. 1 Using OLS as if fixed effects. The GLM Procedure Class Level Information Class Levels Values officer 5 1 2 3 4 5 Number of Observations Read 20 Number of Observations Used 20 Example using Table 25.1 data, page 1036. 2 Using OLS as if fixed effects. The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 4 1579.700000 394.925000 5.39 0.0068 Error 15 1099.250000 73.283333 Corrected Total 19 2678.950000 R-Square Coeff Var Root MSE y Mean 0.589671 11.98120 8.560569 71.45000 Source DF Type I SS Mean Square F Value Pr > F officer 4 1579.700000 394.925000 5.39 0.0068 Source DF Type III SS Mean Square F Value Pr > F officer 4 1579.700000 394.925000 5.39 0.0068 Example using Table 25.1 data, page 1036. 3 Using OLS as if fixed effects. The GLM Procedure Source Type III Expected Mean Square officer Var(Error) + 4 Var(officer) Example using Table 25.1 data, page 1036. 4 ("method=type1" => varcomp estimates as from proc glm.) Variance Components Estimation Procedure Class Level Information Class Levels Values officer 5 1 2 3 4 5 Number of Observations Read 20 Number of Observations Used 20 Dependent Variable: y Type 1 Analysis of Variance Sum of Source DF Squares Mean Square officer 4 1579.700000 394.925000 Error 15 1099.250000 73.283333 Corrected Total 19 2678.950000 . Type 1 Analysis of Variance Source Expected Mean Square officer Var(Error) + 4 Var(officer) Error Var(Error) Corrected Total . Type 1 Estimates Variance Component Estimate Var(officer) 80.41042 Var(Error) 73.28333 Example using Table 25.1 data, page 1036. 5 ("CL" => Satterthwaite-type confidence limits.) ("AsyCov" =>asymptotic covars for varcomps to get z.) The Mixed Procedure Model Information Data Set WORK.APEX Dependent Variable y Covariance Structure Variance Components Estimation Method REML Residual Variance Method Profile Fixed Effects SE Method Model-Based Degrees of Freedom Method Containment Class Level Information Class Levels Values officer 5 1 2 3 4 5 Dimensions Covariance Parameters 2 Columns in X 1 Columns in Z 5 Subjects 1 Max Obs Per Subject 20 Number of Observations Number of Observations Read 20 Number of Observations Used 20 Number of Observations Not Used 0 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 150.94147984 1 1 145.24517813 0.00000000 Convergence criteria met. Covariance Parameter Estimates Cov Parm Estimate Alpha Lower Upper officer 80.4104 0.05 24.4572 1498.97 Residual 73.2833 0.05 39.9896 175.54 Example using Table 25.1 data, page 1036. 6 ("CL" => Satterthwaite-type confidence limits.) ("AsyCov" =>asymptotic covars for varcomps to get z.) The Mixed Procedure Asymptotic Covariance Matrix of Estimates Row Cov Parm CovP1 CovP2 1 officer 4918.68 -179.01 2 Residual -179.01 716.06