Date: Wed, 25 Jun 2003 12:31:49 -02-30 To: David Schneider From: T Avery Subject: Re: Fwd: Re: more questions I have included a data file, a syntax file and an output file that uses the syntax I provide below. The data is saved as both a native SPSS file and a tab delimited file. The output is in native SPSS .spo and as an HTML file (the jpg files are the graphs). The syntax file can be opened in any text editor. I ran this in SPSS 11.0.5. Try it in earlier versions to double check the capabilities. I know that versin 11 added a new MIXED procedure that is simpler than the old methods, but I don't know if adding that procedure added any new functionality or not. I don't think it did. Trevor, do you know of any way to get SPSS to produce only the interaction terms of interest, rather then dumping all the terms into the model ? You need to use the /DESIGN switch. Here is a simple example with 3 variables and only a couple of interactions. You can set these up through the pulldown menus, but it is easier to create a new syntax (under the FILE pulldown) and then run the syntax. If you turn on the draft viewer (under EDIT | OPTIONS | DRAFT VIEWER - set "view commands in log" to on i.e. check it) the commands that you are actually running from using the pulldowns will be displayed in the output. My usual m.o., and what I teach the students to do, is to copy their initial syntax developed by the "user friendly" (and I use the term loosely) puldowns and then tweak the code manually. They then understand the model better, it fits well with what is taught in stats classes (like yours), they can repeat the analysis easily, and they have a lot more control over the design (as many options are either not available or difficult to use in the pulldown world and the students often forget what steps they did in the pulldowns). UNIANOVA var1 BY group time heat /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /PRINT = OPOWER ETASQ /CRITERIA = ALPHA(.05) /DESIGN = group time group*time heat*group*time. This is taken directly from the SPSS manual that is on the CD and optionally is installed to the local computer. It is available through the help menu if installed. I haven't tried a MANCOVA before, (I test one in the attached files), but Model 3 below has the general syntax and the section in the manual under MANOVA has a lot more details. BTW, MANOVA is not available in the pulldowns at all so you have to use the syntax method. You can further define the syntax with the /DESIGN switch. The manual is quite helpful with examples etc., but I include a few websites (no particular order) that I often look at for ideas on syntax. http://www.ats.ucla.edu/stat/spss/faq/default.htm http://pages.infinit.net/rlevesqu/SampleSyntax.htm http://www.utexas.edu/cc/faqs/stat/ http://www.fiu.edu/~chusb001/Personal/Statistics_&_Probability_Links.html http://www.unt.edu/rss/faq/stat0004.htm GLM Models The following are examples of models that can be specified using GLM: Model 1: Univariate or multivariate simple and multiple regression GLM Y WITH X1 X2. GLM Y1 Y2 WITH X1 X2 X3. Model 2: Fixed-effects ANOVA and MANOVA GLM Y1 Y2 by B. Model 3: ANCOVA and multivariate ANCOVA (MANCOVA) GLM Y1 Y2 BY B WITH X1 X2 X3. Model 4: Random-effects ANOVA and ANCOVA GLM Y1 BY C WITH X1 X2 /RANDOM = C. Model 5: Mixed-model ANOVA and ANCOVA GLM Y1 BY B, C WITH X1 X2 /RANDOM = C. Model 6: Repeated measures analysis using a split-plot design (Univariate mixed models approach with subject as a random effect) If drug is a between-subjects factor and time is a within-subjects factor, GLM Y BY DRUG SUBJECT TIME /RANDOM = SUBJECT /DESIGN = DRUG SUBJECT*DRUG TIME DRUG*TIME. Model 7: Repeated measures using the WSFACTOR subcommand Use this model only when there is no random between-subjects effect in the model. For example, if Y1, Y2, Y3, and Y4 are the dependent variables measured at times 1 to 4, GLM Y1 Y2 Y3 Y4 BY DRUG /WSFACTOR = TIME 4 /DESIGN. Model 8: Repeated measures doubly multivariate model Repeated measures fixed-effects MANOVA is also called a doubly multivariate model. Varying or time-dependent covariates are not available. This model can be used only when there is no random between-subjects effect in the model. GLM X11 X12 X13 X21 X22 X23 Y11 Y12 Y13 Y21 Y22 Y23 BY C D /MEASURE = X Y /WSFACTOR = A 2 B 3 /WSDESIGN = A B A*B /DESIGN = C D. Model 9: Means model for ANOVA and MANOVA This model takes only fixed-effect factors (no random effects and covariates) and always assumes the highest order of the interactions among the factors. For example, B, D, and E are fixed factors, and Y1 and Y2 are two dependent variables. You can specify a means model by suppressing the intercept effect and specifying the highest order of interaction on the DESIGN subcommand. GLM Y1 Y2 BY B, D, E /INTERCEPT = EXCLUDE /DESIGN = B*D*E. Also, have you found (?) a way to get just the residual plots that matter, rather than that 3 by 3 thing that SPSS dumps, with 1 graph that is wrong, and 3 graphs that are redundant. UNIANOVA var1 BY group /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /PRINT = DESCRIPTIVE ETASQ OPOWER /SAVE = resid zresid /CRITERIA = ALPHA(.05) /DESIGN = group . Comment I used the /SAVE switch above to save the residuals (resid) and standardized residuals (zresid) to the dataset. These are two of a bunch of predefined variables that can be saved. See the manual for the whole list. Comment I now save all of the dataset including the new variables and rename them at the same time. save outfile="E:\osc_work\tempwork\residdata" /RENAME = (res_1=resid) (zre_1=stanres). Comment I now call back the new datafile (although there are other methods like having hidden datasets like in SAS, I prefer this approach. I only use the resid, but you can substitute the stanres or create a whole new plot. get file="E:\osc_work\tempwork\residdata". Comment And use the plot command to plot what I want. There are many options for plotting. PLOT FORMAT=OVERLAY /TITLE="Residual Plot" /VERTICAL="Residuals" /HORIZONTAL="Group" /PLOT=resid WITH group. Also, SPSS seems to insist on MANOVA, can it be tricked into doing MANCOVA (categorical and regression variables in same model)? Comment MANCOVA. A /DESIGN switch with no terms does the full model. MANOVA var1 BY fact1(1,4) fact2(1,3) WITH covar /DESIGN. Comment I removed the interaction term by explicitly stating the model with the /DESIGN switch. MANOVA var1 BY fact1(1,4) fact2(1,3) WITH covar /DESIGN fact1 fact2. Let me know if you need anything else and/or if this works out. There is only 1 df for the covariable (covar or regression in the output) so it looks to be done correctly. trevor David S. Date: Tue, 24 Jun 2003 11:58:34 -0400 (EDT) From: Mélanie Cousineau Subject: Re: more questions To: David Schneider Hello. The reason I was asking about the interaction terms, is that for some reason, SPSS calculates all of them without any effort on my part... I understand the importance of the interaction terms, so I guess my question was: can they all be calculated anyway, and I would only look at the ones that are of interest to me? I tried to set up only certain interaction terms in the model but was unsuccessful.