One within, one between ANOVA



The A X (B X S) ANOVA: A Multivariate ApproachThe A X (B X S) “mixed” ANOVA, where factor A is between/among subjects and factor B is a repeated measures/within subjects factor, has a sphericity assumption (the same assumption we discussed earlier when studying oneway repeated measures ANOVA). Our example of such a design will be the first experiment in my dissertation, the same example we used for the oneway analysis, but this time we shall not ignore the between subjects Nursing groups variable. After downloading the data file, edit the program “MAN_1W1B.sas,” which can be found on my SAS programs page, to point to the location of the data file and then run the program. Variable NURS is the Nursing Group variable, identifying the species of the subject’s foster mother, Mus, Peromyscus, or Rattus.Mus were Nursed by and raised with, until weaning, Mus, Peromyscus, or Rattus. Later they were tested in an apparatus where they could explore tunnels scented with clean pine shavings, shavings scented of Mus, shavings scented of Peromyscus, or shavings scented of Rattus. For each subject, I recorded the time spent in each tunnel, the number of visits to each tunnel, and the latency to first entry of each tunnel. The scores were positively skewed, so I applied a square root transformation to the times and visits scores and a log transformation to the latency scores. In the variable names, T_, V_ and L_ are the raw scores, and Tt_, Vt_, and Lt_ the transformed scores.Proc Format; value Mom 1='Mus' 2='Peromyscus' 3='Rattus' ;data Mus; infile 'D:\_Stats\StatData\tunnel4b.dat';INPUT Nurs V_clean V_Mus V_Pero V_Rat Vt_clean Vt_Mus Vt_Pero Vt_Rat T_clean T_Mus T_Pero T_Rat Tt_clean Tt_Mus Tt_Pero Tt_Rat L_clean L_Mus L_Pero L_Rat Lt_clean Lt_Mus Lt_Pero Lt_Rat;Format Nurs Mom. ;proc sort; by Nurs;proc means; var T_clean T_Mus T_Pero T_Rat Tt_clean Tt_Mus Tt_Pero Tt_Rat; by Nurs; run;Nurs=MusVariableNMeanStd DevMinimumMaximumT_cleanT_MusT_PeroT_RatTt_cleanTt_MusTt_PeroTt_Rat1212121212121212149.6250000276.4125000266.306250044.49375009.042470414.391481614.60314615.5423156216.3422785254.0166115241.956518245.20165198.63557538.72599617.64349103.946435100000.70710680.70710680.70710680.7071068721.3500000807.9750000897.7500000132.300000026.867266328.433694829.970819111.5238882Nurs=PeromyscusVariableNMeanStd DevMinimumMaximumT_cleanT_MusT_PeroT_RatTt_cleanTt_MusTt_PeroTt_Rat1212121212121212169.3125000494.6812500206.850000035.568750010.163568919.844767510.87774284.3313460289.7342378361.0205706313.418404550.38415068.518281910.51577809.85483984.345303700000.70710680.70710680.70710680.70710681061.551091.481111.95148.050000032.589108633.045045033.353410612.1881090Nurs=RattusVariableNMeanStd DevMinimumMaximumT_cleanT_MusT_PeroT_RatTt_cleanTt_MusTt_PeroTt_Rat1212121212121212125.8687500267.3562500116.4187500196.087500010.505582114.724071610.149657513.065498080.5211675305.817149867.9741387130.30166944.17805897.46321643.89449995.3134745050.400000003.15000000.70710687.13442360.70710681.9104973302.40000001154.48255.1500000499.275000017.404022533.984923115.989058822.3556481proc glm; class Nurs; model Tt_clean Tt_Mus Tt_Pero Tt_Rat = Nurs; repeated scent 4 contrast(1) / summary printe; means Nurs / LSD; run; quit;Note that nurs is identified in GLM’s CLASS statement (nurs is a classification, categorical variable) and in the MODEL statement (nurs is a between subjects independent variable). The MEANS statement is used to obtain means on each of the four variates and to do LSD comparisons between nursing groups on each variate.Sphericity TestsVariablesDFMauchly's CriterionChi-SquarePr?>?ChiSqTransformed Variates50.225453547.254731<.0001Orthogonal Components50.429675726.796536<.0001Mauchly’s criterion (W = .4297) indicates we have a serious lack of sphericity, so if we were to take the univariate approach analysis, we would need to adjust the degrees of freedom for both effects that involve the within-subjects factor, scent.MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no scent EffectH = Type III SSCP Matrix for scentE = Error SSCP MatrixS=1 M=0.5 N=14.5StatisticValueF ValueNum?DFDen?DFPr?>?FWilks' Lambda0.4290876013.75331<.0001Pillai's Trace0.5709124013.75331<.0001Hotelling-Lawley Trace1.3305264513.75331<.0001Roy's Greatest Root1.3305264513.75331<.0001MANOVA Test Criteria and F Approximations for the Hypothesis of no Scent*Nurs EffectH = Type III SSCP Matrix for scent*NursE = Error SSCP MatrixS=2 M=0 N=14.5StatisticValueF ValueNum?DFDen?DFPr?>?FWilks' Lambda0.455800224.976620.0003Pillai's Trace0.581517904.376640.0009Hotelling-Lawley Trace1.112069825.66639.6040.0003Roy's Greatest Root1.0327958311.02332<.0001NOTE: F Statistic for Roy's Greatest Root is an upper bound.NOTE: F Statistic for Wilks' Lambda is exact.The multivariate approach, which does not require sphericity, gives us significant effects for both repeated effects. See “Manova Test Criteria and Exact F Statistics for the Hypothesis of no scent Effect.” This tests the null hypothesis that the “profile” is flat when collapsed across the groups—that is, a plot with mean time on the ordinate and scent of tunnel on the abscissa would produce a flat line, all means being identical. Using PILLAI’S TRACE, which is considered more robust to violations of the MANOVA’s assumption of homogeneity of variancecovariance matrices than is Wilks’ lambda, Scent has a significant main effect, F(3, 31) = 13.75, p < .0001. Box’s M (available with SPSS) may be used to test this homogeneity assumption, but with equal sample sizes (as we have) the MANOVA is considered to be so robust to violations of this assumption that one need not worry about it at all. If sample sizes are quite unequal and Box’s M significant at .001, one may still trust Pillai’s trace or may randomly discard cases to equalize sample sizes.“Manova Test Criteria and Exact F Statistics for the Hypothesis of no scentNURS Effect” shows us that with the multivariate approach the interaction is significant, F(6, 64) 4.37, p = .0009. This test is often called the parallelism test. If we plot each group’s profile (mean time on ordinate, scent of tunnel on abscissa) on an interaction plot, are the profiles parallel to one another or not? The output from PROC MEANS gives the means (in seconds) for the untransformed data. The interaction plot below makes it pretty clear that the profile differs among nursing groups.The GLM ProcedureRepeated Measures Analysis of VarianceTests of Hypotheses for Between Subjects EffectsSourceDFType III SSMean SquareF ValuePr?>?FNurs236.771163618.38558181.020.3709Error33593.514139317.9852769??“Tests of Hypotheses for Between Subjects Effects,” which is appropriate whether we choose a univariate or a multivariate approach, indicate that (ignoring the scent variable) the nursing groups did not significantly differ on total time spent in the tunnels, F(2, 33) = 1.02, p?=?.37.Repeated Measures Analysis of VarianceUnivariate Tests of Hypotheses for Within Subject EffectsSourceDFType III SSMean SquareF ValuePr?>?FAdj Pr > FG?-?GH-F-Lscent31467.267331489.0891107.510.00010.00090.0006scent*Nurs6875.938562145.9897602.240.04540.06950.0646Error(scent)996451.01383165.161756????Greenhouse-Geisser Epsilon0.7087Huynh-Feldt-Lecoutre Epsilon0.7588Look at the “Univariate Tests of Hypotheses for Within Subject Effects.” Note that the unadjusted tests are both significant, Scent at .0001, ScentNurs at .0454, but we already decided we need to adjust the degrees of freedom. The adjustment involves multiplying both numerator and denominator df by SYMBOL 101 \f "Symbol" (epsilon). Rather than using the overly conservative GreenhouseGeisser SYMBOL 101 \f "Symbol" (.7087), I elected to use the more powerful HuynhFeldt SYMBOL 101 \f "Symbol" (.8047). One should use the Huynh-Feldt rather than the Greenhouse-Geisser when SYMBOL 101 \f "Symbol" lies near or above 0.75. SAS gives the adjusted p’s. Scent’s main effect remains significant, F(2.41, 79.67) = 7.51, p = .0005), but the ScentNurs interaction now falls short of significance, F(4.83, 79.67) = 2.24, p = .060).Simple Effects of the Between-Subjects Factor at Each Level of the Within-Subjects Factor. Since I did not employ the ‘nouni’ keyword, the first results from GLM are the simple effects of nursing groups at each level of Scent. These analyses indicate that the nursing groups do not differ significantly from one another on time spent in the clean tunnel, F(2, 33) = 0.13, p = .88, the Musscented tunnel, F(2, 33) = 1.39, p = .26, or the Peromyscusscented tunnel F(2, 33) = 1.2, p = .31, but do on the Rattusscented tunnel, F(2, 33) = 12.86, p < .0001. The LSD comparisons, later in the output, show that the ratreared mice spent significantly more time in the ratscented tunnel than did the other two groups of mice, which did not differ significantly from each other. Do note that SAS has used “individual error terms,” one for each level of Scent. In his chapter on repeated measures ANOVA, Howell explains how you could use a possibly more powerful pooled error term instead.Simple Effects of Nursing Groups at Each Level of ScentDependent Variable: Tt_clean SourceDFSum of SquaresMean SquareF ValuePr?>?FModel214.0581247.0290620.130.8802Error331810.49509454.863488??Corrected Total351824.553218???Dependent Variable: Tt_Mus SourceDFSum of SquaresMean SquareF ValuePr?>?FModel2224.281876112.1409381.390.2638Error332666.66613680.808065??Corrected Total352890.948012???Tt_Pero SourceDFSum of SquaresMean SquareF ValuePr?>?FModel2136.96919268.4845961.200.3130Error331877.78745856.902650??Corrected Total352014.756649???Dependent Variable: Tt_RatSourceDFSum of SquaresMean SquareF ValuePr?>?FModel2537.400534268.70026712.86<.0001Error33689.57928220.896342??Corrected Total351226.979816???Pairwise Comparisons by Scent of Tunnelt Tests (LSD) for Tt_cleanMeans with the same letter are notsignificantly different.t?GroupingMeanNNursA10.50612RattusA???A10.16412PeromyscusA???A9.04212Must Tests (LSD) for Tt_MusMeans with the same letter are notsignificantly different.t?GroupingMeanNNursA19.84512PeromyscusA???A14.72412RattusA???A14.39112Must Tests (LSD) for Tt_PeroMeans with the same letter are notsignificantly different.t?GroupingMeanNNursA14.60312MusA???A10.87812PeromyscusA???A10.15012Rattust Tests (LSD) for Tt_RatMeans with the same letter are notsignificantly different.t?GroupingMeanNNursA13.06512Rattus????B5.54212MusB???B4.33112PeromyscusLook at the “Analysis of Variance of Contrast Variables.” I contrasted time in the unscented tunnel with time in each of the other tunnels. The first constrast is with the Mus tunnel. The mice averaged significantly more time in the Musscented tunnel (346 sec) than in the clean tunnel (148 sec), F(1, 33) = 7.67, p = .009, but the nursing groups did not significantly differ from each other with respect to this contrast, F(2, 33) = 0.52, p = .60. None of the contrasts involving the Peromyscus-scented tunnel or the Rattus-scented tunnel were significant, but both involving the Rattus-scented tunnel were. Ignoring nursing groups, the mice spent significantly less time in the Rattus-scented tunnel than in the clean tunnel, F(1, 33) = 22.20, p , .001, and this contrast interacted significantly with the nursing groups variable, F(2,?33) = 4.72, p = ..016. Note that this contrast interaction analysis is equivalent to a Scent X Nursing Group interaction where Scent is restricted to Mus versus Rattus.Analysis of Variance of Contrast Variables?scent_N represents the contrast between the nth level of scent and the 1stContrast Variable: scent_2 Mus versus Clean SourceDFType III SSMean SquareF ValuePr?>?FMean11482.0496921482.0496927.670.0092Nurs2199.54846499.7742320.520.6015Error336378.416216193.285340??Contrast Variable: scent_3 Peromyscus versus Clean SourceDFType III SSMean SquareF ValuePr?>?FMean1140.134694140.1346941.160.2897Nurs2238.559400119.2797000.990.3839Error333993.265010121.008031??Contrast Variable: scent_4 Rattus versus Clean SourceDFType III SSMean SquareF ValuePr?>?FMean1183.464951183.4649512.600.1161Nurs2450.363977225.1819893.200.0538Error332324.58175670.441871??Notice that the interaction between nursing groups and this contrast was nearly significant.Simple Effects of the Within-Subjects Factor at Each Level of the Between-Subjects Factor.proc glm; model Tt_clean Tt_Mus Tt_Pero Tt_Rat = / nouni; repeated scent 4 contrast(4) / summary; by Nurs;title 'Simple Effects Analyses of Scent by Level of Nursing Group.'; run; quit;Nurs=MusMANOVA Test Criteria and Exact F Statistics for the Hypothesis of no Scent EffectH = Type III SSCP Matrix for scentE = Error SSCP MatrixS=1 M=0.5 N=3.5StatisticValueF ValueNum?DFDen?DFPr?>?FWilks' Lambda0.1528963416.62390.0005Pillai's Trace0.8471036616.62390.0005Hotelling-Lawley Trace5.5403789516.62390.0005Roy's Greatest Root5.5403789516.62390.0005Univariate Tests of Hypotheses for Within Subject EffectsNurs=MusSourceDFType III SSMean SquareF ValuePr?>?FAdj Pr > FG?-?GH - Fscent3696.705923232.2353083.470.02690.04790.0362Error(scent)332206.70425466.869826????Greenhouse-Geisser Epsilon0.6784Huynh-Feldt Epsilon0.8338scent_N represents the contrast between the nth level of scent and the 4th (the reference scent is Rattus)Contrast Variable: scent_1 Clean vs SourceDFType III SSMean SquareF ValuePr?>?FMean1147.0129968147.01299681.740.2144Error11931.383767384.6712516??Contrast Variable: scent_2 Mus vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean1939.692861939.6928617.980.0165Error111295.744198117.794927??Contrast Variable: scent_3 Peromyscus vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean1985.1837800985.183780022.790.0006Error11475.512705443.2284278??Nurs=PeromyscusMANOVA Test Criteria and Exact F Statistics for the Hypothesis of no scent EffectH = Type III SSCP Matrix for scentE = Error SSCP MatrixS=1 M=0.5 N=3.5StatisticValueF ValueNum?DFDen?DFPr?>?FWilks' Lambda0.1629866815.41390.0007Pillai's Trace0.8370133215.41390.0007Hotelling-Lawley Trace5.1354707315.41390.0007Roy's Greatest Root5.1354707315.41390.0007Univariate Tests of Hypotheses for Within Subject EffectsNurs=PeromyscusSourceDFType III SSMean SquareF ValuePr?>?FAdj Pr > FG?-?GH - Fscent31476.538686492.1795625.270.00440.01170.0065Error(scent)333080.45130793.347009????Greenhouse-Geisser Epsilon0.7083Huynh-Feldt Epsilon0.8825scent_N represents the contrast between the nth level of scent and the 4thNurs=PeromyscusContrast Variable: scent_1 Clean vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean1408.1778954408.17789544.550.0563Error11987.134240289.7394764??Contrast Variable: scent_2 Mus vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean12887.9949512887.99495123.500.0005Error111351.938801122.903527??Contrast Variable: scent_3 Peromyscus vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean1514.263738514.2637384.520.0570Error111252.450744113.859159??Nurs=RattusMANOVA Test Criteria and Exact F Statistics for the Hypothesis of no scent EffectH = Type III SSCP Matrix for scentE = Error SSCP MatrixS=1 M=0.5 N=3.5StatisticValueF ValueNum?DFDen?DFPr?>?FWilks' Lambda0.598007052.02390.1822Pillai's Trace0.401992952.02390.1822Hotelling-Lawley Trace0.672221092.02390.1822Roy's Greatest Root0.672221092.02390.1822Univariate Tests of Hypotheses for Within Subject EffectsNurs=RattusSourceDFType III SSMean SquareF ValuePr?>?FAdj Pr > FG?-?GH - Fscent3169.96128456.6537611.610.20660.22900.2264Error(scent)331163.85826935.268432????Greenhouse-Geisser Epsilon0.5230Huynh-Feldt Epsilon0.5948scent_N represents the contrast between the nth level of scent and the 4thNurs=RattusContrast Variable: scent_1 SourceDFType III SSMean SquareF ValuePr?>?FMean178.638036278.63803622.130.1724Error11406.063748136.9148862??Contrast Variable: scent_2 SourceDFType III SSMean SquareF ValuePr?>?FMean133.01039433.0103940.260.6179Error111378.595766125.326888??Contrast Variable: scent_3 Peromyscus vs Rattus SourceDFType III SSMean SquareF ValuePr?>?FMean1102.0255116102.02551165.740.0354Error11195.391978017.7629071??The second invocation of PROC GLM was used to conduct simple effects analysis of scent by level of nursing groups. One simply does a oneway repeated measures analysis “BY N;”. Simple effects analysis conducted this way use “individual error terms”—that is, at each level of nurs the analysis uses an error term computed using only the data at that level of nurs. Howell advocated use of the pooled error term from the overall analysis in the 2nd edition of his text (pages 433-434), but switched to individual error terms for the simple effects of the within-subjects factor at each level of the between-subjects factor in the 3rd edition (page 449). For the multivariate approach, SAS gives us individual error term analyses. For the Musnursed animals scent had a significant effect, F(3, 9) = 16.62, p?=?.0005, with the contrast between Mus-scent and Rattus-scent being significant. For the Peromyscusnursed animals scent had a significant effect, F(3, 9) = 15.41, p = .0007, with the contrast between Mus-scent and Rattus-scent being significant. Among the Rattus-nursed mice, however, the effect of scent of tunnel was not statistically significant, F(3, 9) = 2.02, p?=?.18.SAS also employs individual error terms for the univariate approach simple effects. The basic results are the same as with the multivariate approach analysis. For the univariate approach simple effects, if you wanted to use the pooled error from the overall analysis (MSE = 65.162 on 99 df), you would compute the F’s yourself—for the Musnursed mice, F?=?232.235/65.162 = 3.564. Adjust the df using the HuynhFeldt SYMBOL 101 \f "Symbol", from the omnibus analysis, .8047, yielding F(2.41, 79.67) = 3.564. Use SAS’ PROBF to obtain p.For our data, using individual error terms, both the univariate and multivariate approaches indicated a significant simple main effect of Scent for Musnursed and Peromyscusnursed mice but not for Rattusnursed mice. If you wish to take a multivariate approach to the simple main effects of the repeated factor and you wish to use a pooled error term, use the SPSS MANOVA routine explained below.SPSS: Point and ClickBring into SPSS the data file TUNNEL4b.sav. Click Analyze, General Linear Model, Repeated Measures. In the “Within-Subject Factor Name” box, enter “scent.” For “Number of Levels” enter “4.” Click Add. Select “scent(4)” and click Define. Select t_clean, t_mus, t_pero, and t_rat (these are the transformed variables) and scoot them into the “Within-Subjects Variables” box. Select “nurs” and scoot it into the “Between-Subjects Factor(s)” box.466915525717500Click Post Hoc and scoot “nurs” into the “Post-hoc tests for” box. Ask for LSD tests, Continue.Click Contrasts. Select the contrast for “scent.” Under “Change Contrast” select “Simple” and then select “last” for the “Reference Category,” as shown to the right.Click Change, Continue, OK. You will find that you get the same basic statistics that we got with SAS. Since the omnibus effect of the scent variable was not significant, our use of the “post hoc” Fisher’s LSD was only for pedagogical purpose. Do note that the output for that test includes both p values (“Sig”) and confidence intervals for differences between means.SPSS: SyntaxWhile you still have the tunnel4b data in SPSS, paste this code into the syntax window and run it:manova t_clean to t_rat by nurs(1,3) / wsfactors = scent(4) / contrast(scent)=special(1,1,1,1, -3,1,1,1, 0,-2,1,1, 0,0,-1,1) / rename=overall c_vs_mpr m_vs_pr p_vs_r / wsdesign = scent / print=signif(univ) error(cor) homogeneity(boxm) / design .manova t_clean to t_rat by nurs(1,3) / wsfactors = scent(4) / wsdesign = mwithin scent(1) mwithin scent(2) mwithin scent(3) mwithin scent(4) / design = nurs .manova t_clean to t_rat by nurs(1,3) / wsfactors = scent(4) / wsdesign = scent / design = mwithin nurs(1) mwithin nurs(2) mwithin nurs(3) .The Box’s M output shows that we have no problem with MANOVA’s homogeneity assumption. One of our orthogonal contrasts, P_VS_R, was significant for the interaction between nursing group and scent of tunnel, that is, the nursing groups differed significantly on the Peromyscus versus Rattus contrast The significant M_VS_PR and P_V_R contrasts found in our earlier oneway analysis appear here also.The second invocation of MANOVA was used to evaluate the simple main effects of Nursing groups at each level of Scent. “WSDESIGN = MWITHIN SCENT(1) MWITHIN SCENT(2) MWITHIN SCENT(3) MWITHIN SCENT(4)” is the command specifying the simple effects analysis. In the output, under “Tests involving ‘MWITHIN SCENT(1)’ WithinSubject Effect” the “NURS BY MWITHIN SCEN” F(2, 33) = 0.13, p = .88 is the test for the simple main effect of Nursing groups upon response to the Scent(1) clean tunnel. Note that like SAS, SPSS used individual rather than pooled error. The tests for the Mus, Peromyscus, and Rattusscented tunnels follow.The third invocation of MANOVA was used to evaluate the simple main effects of Scent at each level of Nursing groups. “DESIGN = MWITHIN NURS(1) MWITHIN NURS(2) MWITHIN NURS(3)” specifies the simple effects. “EFFECT...MWITHIN NURS(3) BY SCENT Multivariate Tests of Significance” gives the multivariate approach pooled error test for the effect of Scent in Nursing Group 3, the Rattusnursed mice, for which the effect was not significant, F(3, 31) = 0.867, p = .47. Note that the df (3, 31) are the same as for Scent in the omnibus multivariate analysis, since we are using pooled error. We do have significant simple main effects of scent for the Peromyscusnursed and Musnursed mice. Finally, the poolederror, univariate approach statistics under “AVERAGED Tests of Significance for MEAS.1 using UNIQUE sums of squares” also indicate significant effects for Mus and Peromyscusnursed but not Rattusnursed mice, F’s (3, 99) = 3.56, 7.55, and 0.87. Note that these are the same F’s we would need compute by hand were we using SAS and wanting pooled error univariate tests. We would still need adjust the df and obtain the adjusted p, as SPSS MANOVA does not do that for us.Copyright 2020, Karl L. Wuensch - All rights reserved.Annotated Output from SASPartial and Semipartial Eta SquaredFair Use of this Document ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download