Data from table 23.3, page 515: narrow format.
data list list / s a b c y . begin data. 1 1 1 1 11 1 1 1 2 5 1 1 1 3 3 2 1 1 1 12 2 1 1 2 10 2 1 1 3 5 3 1 2 1 17 3 1 2 2 11 3 1 2 3 11 4 1 2 1 18 4 1 2 2 16 4 1 2 3 13 5 2 1 1 20 5 2 1 2 14 5 2 1 3 13 6 2 1 1 12 6 2 1 2 10 6 2 1 3 9 7 2 2 1 16 7 2 2 2 10 7 2 2 3 10 8 2 2 1 20 8 2 2 2 18 8 2 2 3 14 9 3 1 1 23 9 3 1 2 17 9 3 1 3 18 10 3 1 1 22 10 3 1 2 19 10 3 1 3 22 11 3 2 1 14 11 3 2 2 8 11 3 2 3 8 12 3 2 1 18 12 3 2 2 16 12 3 2 3 12 end data.
Table 23.3, page 515. Analysis of variance of mixed three-way factorial design with two between-subject factors (factor a and factor b) and one within-subject factor (factor c) on a narrow formatted data set.
NOTE: glm on the narrow data set in a A*B*(C*S) design is more complex than either mixed or glm on the wide data set. The complexities arises since we have to specify the nesting of factors and define customized tests for the between and within subject factors. Table 23.2 and page 512-514, discuss the correct error terms with respect to design .
glm y by s a b c /design a b a*b s(a*b) c a*c b*c a*b*c c*s(a*b) /test a vs s(a*b) /test b vs s(a*b) /test a*b vs s(a*b) /test c vs c*s(a*b) /test a*c vs c*s(a*b) /test b*c vs c*s(a*b) /test a*b*c vs c*s(a*b).
Custom Hypothesis Tests #1
Custom Hypothesis Tests #2
Custom Hypothesis Tests #3
Custom Hypothesis Tests #4
Custom Hypothesis Tests #5
Custom Hypothesis Tests #6
Custom Hypothesis Tests #7
mixed y by a b c /print = solution /fixed a b c a*b a*c b*c a*b*c /repeated = a b c | subject(s) covtype(cs).
Fixed Effects
Covariance Parameters
Data from table 23.3, page 515: wide format.
data list list /s a b c1 c2 c3. begin data. 1 1 1 11 5 3 2 1 1 12 10 5 3 1 2 17 11 11 4 1 2 18 16 13 5 2 1 20 14 13 6 2 1 12 10 9 7 2 2 16 10 10 8 2 2 20 18 14 9 3 1 23 17 18 10 3 1 22 19 22 11 3 2 14 8 8 12 3 2 18 16 12 end data.
glm c1 c2 c3 by a b /wsfactors c(3).
Data from table 23.4, page 517.
data list list /s a b c y. begin data. 1 1 1 1 1 1 1 2 1 1 1 1 3 1 2 1 1 1 2 1 1 1 2 2 3 1 1 3 2 2 1 1 1 3 2 1 1 2 3 4 1 1 3 3 2 2 1 1 1 2 2 1 2 1 3 2 1 3 1 3 2 1 1 2 2 2 1 2 2 4 2 1 3 2 4 2 1 1 3 3 2 1 2 3 5 2 1 3 3 4 3 1 1 1 1 3 1 2 1 2 3 1 3 1 3 3 1 1 2 3 3 1 2 2 3 3 1 3 2 5 3 1 1 3 2 3 1 2 3 5 3 1 3 3 5 4 2 1 1 2 4 2 2 1 1 4 2 3 1 1 4 2 1 2 2 4 2 2 2 2 4 2 3 2 2 4 2 1 3 3 4 2 2 3 3 4 2 3 3 2 5 2 1 1 3 5 2 2 1 2 5 2 3 1 3 5 2 1 2 3 5 2 2 2 4 5 2 3 2 3 5 2 1 3 5 5 2 2 3 5 5 2 3 3 4 6 2 1 1 1 6 2 2 1 2 6 2 3 1 1 6 2 1 2 2 6 2 2 2 3 6 2 3 2 3 6 2 1 3 1 6 2 2 3 3 6 2 3 3 2 end data.
Table 23.4, page 517. Analysis of variance of a mixed three-way factorial design with one between-subject factor (factor A) and two within-subject factors ( factor B and factor C).
glm y by a b c s /design a b s(a) a*b b*s(a) c a*c c*s(a) b*c a*b*c b*c*s(a) /test a vs s(a) /test b vs b*s(a) /test a*b vs b*s(a) /test c vs c*s(a) /test a*c vs c*s(a) /test b*c vs b*c*s(a) /test a*b*c vs b*c*s(a).
Custom Hypothesis Tests #1
Custom Hypothesis Tests #2
Custom Hypothesis Tests #3
Custom Hypothesis Tests #4
Custom Hypothesis Tests #5
Custom Hypothesis Tests #6
Custom Hypothesis Tests #7
Table 23.10, page 526. Analysis of the between-subjects simple interaction A*B at level c3 of the within-subject factor from Table 23.3.
NOTE: Evaluating the design at a specific level of a within-subject factor reduces the design to a two-factor between-subject design.
temporary. select if c = 3. glm y by a b.
temporary. select if c = 3. mixed y by a b /print = solution /fixed = a b a*b /repeated = a b |subject(s) covtype(cs).
Fixed Effects
Covariance Parameters
When the data from Table 23.3 has a wide format.
glm c3 by a b.
Table 23.12, page 528. Simple effects of factor B and C for female subjects from the data in Table 23.4 using only the restricted error terms.
NOTE: Restricting the design to one level of the between subject factor reduces the design to a two-factor within-subject design.
temporary. select if a = 1. glm y by s b c /test b vs b*s /test c vs c*s /test b*c vs s*b*c.
Custom Hypothesis Tests #1
Custom Hypothesis Tests #2
Custom Hypothesis Tests #3