* These lines create a file of output of the designated type ; * ods html file='c:\temp\CastingResults.html'; * ods rtf file='c:\temp\CastingResults.rtf'; * ods pdf file='c:\temp\CastingResults.pdf'; data alloys ; input casting strength @@ ; cards ; 1 88. 1 88. 1 94.8 1 90. 1 93.0 1 89. 1 86. 1 92.9 1 89. 1 93. 2 85.9 2 88.6 2 90. 2 87.1 2 85.6 2 86. 2 91. 2 89.6 2 93. 2 87.5 3 94.2 3 91.5 3 92. 3 96.5 3 95.6 3 93.8 3 92.5 3 93.2 3 96.2 3 92.5 ; proc print data = alloys ; run ; * Proc GLM must be used to obtain the F test ; proc glm data = alloys ; class casting ; model strength = casting ; random casting ; run ; * Proc MIXED calculates estimates of covariance parameters using the REML method (restricted maximum likelihood) ; proc mixed data = alloys covtest cl alpha = .1 ; ods output CovParms = covpar ; class casting ; model strength = ; random casting ; run ; * this code calculates the intraclass correlation ; data icc_calc ; set covpar ; retain siga ; if covparm = 'casting' then siga = estimate ; if covparm = 'Residual' then sige = estimate ; icc = siga/(siga +sige) ; keep covparm estimate icc ; run ; proc print data = icc_calc ; run ; * The lines below close the files opened above and resume usual (html) output ; * ods _all_ close; ods html;