Search code examples
spss

OMS for UNIANOVA isn't working for Estimated Marginal Means?


Using SPSS v.26, I am seeking to use OMS to generate a new dataset that contains the grand mean and estimated means for independent variables using the UNIANOVA command. The dependent variable is 'WSoPSS'; the independent variable is 'PathwayID', and there is a covariate as 'P1Cov'. Syntax as follows:

DATASET DECLARE  Run01.
OMS
  /SELECT TABLES
  /IF COMMANDS=['UNIANOVA'] SUBTYPES=[' Estimated Marginal Means']
  /DESTINATION FORMAT=SAV NUMBERED=TableNumber_
   OUTFILE='Run01' VIEWER=YES
  /TAG='Run01'.

  UNIANOVA WSoPSS BY PathwayID WITH P1Cov
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) WITH(P1Cov=MEAN) 
  /EMMEANS=TABLES(PathwayID) WITH(P1Cov=MEAN) COMPARE ADJ(LSD)
  /PRINT ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=P1Cov PathwayID.

OMSEND    tag = ['Run01'].

The analysis and output is all fine, but the OMS triggers an error: "OMS cannot produce the requested dataset or file. In SAV format, all tables selected must have the same number of columns. The number of columns in table Estimates does not match the number of columns in the previous tables (2:1)."

This is the entirety of the syntax I am running. Hours of searching IBM manuals hasn't revealed an explanation, so any assistance would be greatly appreciated, cheers.


Solution

  • The problem is you have two EMMEANS subcommands in your test:

      /EMMEANS=TABLES(OVERALL) WITH(P1Cov=MEAN) 
      /EMMEANS=TABLES(PathwayID) WITH(P1Cov=MEAN) COMPARE ADJ(LSD)
    

    the first one produces the table for the GRAND MEAN, and the second produces a table with analysis by PathwayID. The two tables have a different number of columns (the second table has an extra column for PathwayID), and that's what prevents the OMS from stacking them into one table.
    Assuming what you need is only the second table, if you just delete the first of the two rows in the command the 'OMS' will work fine.