Data from Table 19.4, page 439
data table19_4; input s a b seeds @@; datalines; 1 1 1 13 1 1 2 14 1 1 3 17 1 1 4 20 2 1 1 10 2 1 2 11 2 1 3 15 2 1 4 14 3 1 1 13 3 1 2 19 3 1 3 18 3 1 4 22 4 1 1 4 4 1 2 12 4 1 3 14 4 1 4 16 5 2 1 5 5 2 2 13 5 2 3 21 5 2 4 24 6 2 1 8 6 2 2 18 6 2 3 25 6 2 4 27 7 2 1 14 7 2 2 19 7 2 3 26 7 2 4 26 8 2 1 12 8 2 2 24 8 2 3 29 8 2 4 29 9 3 1 13 9 3 2 24 9 3 3 28 9 3 4 32 10 3 1 9 10 3 2 22 10 3 3 22 10 3 4 24 11 3 1 14 11 3 2 22 11 3 3 28 11 3 4 28 12 3 1 8 12 3 2 18 12 3 3 27 12 3 4 29 ; run; data table19_4w; input s a b1 b2 b3 b4; datalines; 1 1 13 14 17 20 2 1 10 11 15 14 3 1 13 19 18 22 4 1 4 12 14 16 5 2 5 13 21 24 6 2 8 18 25 27 7 2 14 19 26 26 8 2 12 24 29 29 9 3 13 24 28 32 10 3 9 22 22 24 11 3 14 22 28 28 12 3 8 18 27 29 ; run;
Table 19.4, page 439. Numerical Example of a Mixed Ax(BxS) design
NOTE1: The parenthesis ( ) denote nesting. In this example, subjects
are nested within Factor A.
NOTE2: The proc glm for the narrow data set is a lot more complicated
than either the proc glm on the wide data set or the proc mixed on
on the narrow data set.
proc glm data = table19_4; class s a b; model seeds = a|b|s(a) /ss3; test h = a e = s(a); test h = b e = b*s(a); test h = a*b e = s*b(a); run; quit;
The GLM Procedure Class Level Information Class Levels Values s 12 1 2 3 4 5 6 7 8 9 10 11 12 a 3 1 2 3 b 4 1 2 3 4 Number of observations 48 Dependent Variable: seeds Sum of Source DF Squares Mean Square F Value Pr > F Model 47 2419.000000 51.468085 . . Error 0 0.000000 . Corrected Total 47 2419.000000 R-Square Coeff Var Root MSE seeds Mean 1.000000 . . 18.75000 Source DF Type III SS Mean Square F Value Pr > F a 2 458.000000 229.000000 . . b 3 1405.500000 468.500000 . . a*b 6 155.500000 25.916667 . . s(a) 9 301.000000 33.444444 . . s*b(a) 27 99.000000 3.666667 . . Tests of Hypotheses Using the Type III MS for s(a) as an Error Term Source DF Type III SS Mean Square F Value Pr > F a 2 458.0000000 229.0000000 6.85 0.0156 Tests of Hypotheses Using the Type III MS for s*b(a) as an Error Term Source DF Type III SS Mean Square F Value Pr > F b 3 1405.500000 468.500000 127.77 <.0001 a*b 6 155.500000 25.916667 7.07 0.0001
proc glm data = table19_4w; class a; model b1 b2 b3 b4 = a / ss3; repeated b 4; run; quit;
[b-level output omitted]
The GLM Procedure Repeated Measures Analysis of Variance Repeated Measures Level Information Dependent Variable b1 b2 b3 b4 Level of b 1 2 3 4 Manova Test Criteria and Exact F Statistics for the Hypothesis of no b Effect H = Type III SSCP Matrix for b E = Error SSCP Matrix S=1 M=0.5 N=2.5 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.03191968 70.77 3 7 <.0001 Pillai's Trace 0.96808032 70.77 3 7 <.0001 Hotelling-Lawley Trace 30.32863944 70.77 3 7 <.0001 Roy's Greatest Root 30.32863944 70.77 3 7 <.0001 Manova Test Criteria and F Approximations for the Hypothesis of no b*a Effect H = Type III SSCP Matrix for b*a E = Error SSCP Matrix S=2 M=0 N=2.5 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.17277151 3.28 6 14 0.0314 Pillai's Trace 0.92601669 2.30 6 16 0.0859 Hotelling-Lawley Trace 4.21620600 4.73 6 7.7895 0.0251 Roy's Greatest Root 4.07592236 10.87 3 8 0.0034 NOTE: F Statistic for Roy's Greatest Root is an upper bound. NOTE: F Statistic for Wilks' Lambda is exact.
Tests of Hypotheses for Between Subjects Effects Source DF Type III SS Mean Square F Value Pr > F a 2 458.0000000 229.0000000 6.85 0.0156 Error 9 301.0000000 33.4444444
Univariate Tests of Hypotheses for Within Subject Effects Adj Pr > F Source DF Type III SS Mean Square F Value Pr > F G - G H - F b 3 1405.500000 468.500000 127.77 <.0001 <.0001 <.0001 b*a 6 155.500000 25.916667 7.07 0.0001 0.0006 0.0001 Error(b) 27 99.000000 3.666667 Greenhouse-Geisser Epsilon 0.7903 Huynh-Feldt Epsilon 1.3301
proc mixed data = table19_4; class s a b ; model seeds = a | b; repeated / subject = s type = cs; run; quit;
The Mixed Procedure Model Information Data Set WORK.TABLE19_4 Dependent Variable seeds Covariance Structure Compound Symmetry Subject Effect s Estimation Method REML Residual Variance Method Profile Fixed Effects SE Method Model-Based Degrees of Freedom Method Between-Within Class Level Information Class Levels Values s 12 1 2 3 4 5 6 7 8 9 10 11 12 a 3 1 2 3 b 4 1 2 3 4 Dimensions Covariance Parameters 2 Columns in X 20 Columns in Z 0 Subjects 12 Max Obs Per Subject 4 Observations Used 48 Observations Not Used 0 Total Observations 48 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 205.48514864 1 1 185.46871848 0.00000000 Convergence criteria met. Covariance Parameter Estimates Cov Parm Subject Estimate CS s 7.4444 Residual 3.6667
Fit Statistics -2 Res Log Likelihood 185.5 AIC (smaller is better) 189.5 AICC (smaller is better) 189.8 BIC (smaller is better) 190.4 Null Model Likelihood Ratio Test DF Chi-Square Pr > ChiSq 1 20.02 <.0001 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F a 2 9 6.85 0.0156 b 3 27 127.77 <.0001 a*b 6 27 7.07 0.0001