This chapter uses the data file called hsb12.sas7bdat and you can download it here.
Table 4.1 on page 69.
proc means data = in.hsb12 mean std; var mathach ses; run;
Variable Mean Std Dev ---------------------------------------- MATHACH 12.7478526 6.8782457 SES 0.000143354 0.7793552 ---------------------------------------- proc sql; create table school_level as select distinct meanses, sector, school from in.hsb12 order by school; quit; proc means data = school_level mean std; var sector meanses; run;
Variable Mean Std Dev ---------------------------------------- SECTOR 0.4375000 0.4976359 MEANSES -0.000187500 0.4139731 ----------------------------------------
Table 4.2 on page 70, one-way ANOVA model.
proc mixed data = in.hsb12 covtest noclprint; class school; model mathach = /solution; random intercept /subject = school; run;
Covariance Parameter Estimates
Standard Z Cov Parm Subject Estimate Error Value Pr Z
Intercept SCHOOL 8.6097 1.0778 7.99 <.0001 Residual 39.1487 0.6607 59.26 <.0001
Fit Statistics
-2 Res Log Likelihood 47116.8 AIC (smaller is better) 47120.8 AICC (smaller is better) 47120.8 BIC (smaller is better) 47126.9
Solution for Fixed Effects
Standard Effect Estimate Error DF t Value Pr > |t|
Intercept 12.6370 0.2443 159 51.72 <.0001
Table 4.3 on page 73, means-as-outcomes model.
proc mixed data = in.hsb12 covtest noclprint ; class school; model mathach = meanses /solution notest; random intercept /subject = school; run;
Covariance Parameter Estimates
Standard Z Cov Parm Subject Estimate Error Value Pr Z
Intercept SCHOOL 2.6357 0.4036 6.53 <.0001 Residual 39.1578 0.6608 59.26 <.0001
Fit Statistics
-2 Res Log Likelihood 46961.3 AIC (smaller is better) 46965.3 AICC (smaller is better) 46965.3 BIC (smaller is better) 46971.4
Solution for Fixed Effects
Standard Effect Estimate Error DF t Value Pr > |t|
Intercept 12.6495 0.1492 158 84.77 <.0001 MEANSES 5.8635 0.3613 7025 16.23 <.0001
Table 4.4 on page 77, random-coefficient model.
data hsb12c; set in.hsb12; cses = ses - meanses; run; proc mixed data = hsb12c covtest noclprint ; class school; model mathach = cses /solution notest; random intercept cses/subject = school; run;
Covariance Parameter Estimates
Standard Z Cov Parm Subject Estimate Error Value Pr Z
Intercept SCHOOL 8.6762 1.0785 8.04 <.0001 cses SCHOOL 0.6940 0.2808 2.47 0.0067 Residual 36.7006 0.6258 58.65 <.0001
Fit Statistics
-2 Res Log Likelihood 46714.3 AIC (smaller is better) 46720.3 AICC (smaller is better) 46720.3 BIC (smaller is better) 46729.5
Solution for Fixed Effects
Standard Effect Estimate Error DF t Value Pr > |t|
Intercept 12.6492 0.2444 159 51.75 <.0001 cses 2.1926 0.1283 159 17.10 <.0001
Table 4.5 on page 82, intercepts- and slopes-as-outcomes model.
proc mixed data = hsb12c covtest noclprint ; class school; model mathach = meanses sector cses cses*meanses cses*sector / ddfm = bw solution notest; random intercept cses/ type = un subject = school; run;
Covariance Parameter Estimates
Standard Z Cov Parm Subject Estimate Error Value Pr Z
UN(1,1) SCHOOL 2.3817 0.3717 6.41 <.0001 UN(2,1) SCHOOL 0.1926 0.2045 0.94 0.3464 UN(2,2) SCHOOL 0.1014 0.2138 0.47 0.3177 Residual 36.7212 0.6261 58.65 <.0001
Fit Statistics
-2 Res Log Likelihood 46503.7 AIC (smaller is better) 46511.7 AICC (smaller is better) 46511.7 BIC (smaller is better) 46524.0
Null Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
3 220.57 <.0001
Solution for Fixed Effects
Standard Effect Estimate Error DF t Value Pr > |t|
Intercept 12.1136 0.1988 157 60.93 <.0001 MEANSES 5.3391 0.3693 157 14.46 <.0001 SECTOR 1.2167 0.3064 157 3.97 0.0001 cses 2.9388 0.1551 7022 18.95 <.0001 MEANSES*cses 1.0389 0.2989 7022 3.48 0.0005 SECTOR*cses -1.6426 0.2398 7022 -6.85 <.0001
Figure 4.1 on page 83.