SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only

Mixed Linear Models and /test command for contrasts

  • 1.  Mixed Linear Models and /test command for contrasts

    Posted Fri December 11, 2020 06:08 PM
    Hi!
    Hope you are all okay and safe! 
    First of all, my English is not perfect, so if I said something wrong I am sorry for that. 

    I am having troubles with the /test subcommand in linear mixed models
    I am working with a database in a long format, with 2 groups (intervention vs control) and 3 time points (0, 4 and 12mo). I ran perfectly the mixed models, however, I would like to see the difference in differences, i.e., if the difference of differences from 0 to 4mo between control and intervention. I know SPSS is a bit tricky in this situation and I only found material for GLM which I need to have a wide form database. 

    This is my syntax (the intervention effect on weight):

    MIXED Weight_1 BY time condition WITH Weight_bas
    /CRITERIA=DFMETHOD(SATTERTHWAITE) CIN(95) MXITER(100) MXSTEP(10) SCORING(1)
    SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
    /FIXED=time condition time*condition | SSTYPE(3)
    /METHOD=REML
    /PRINT=LMATRIX SOLUTION TESTCOV
    /REPEATED=time | SUBJECT(subject) COVTYPE(UN)
    /EMMEANS=TABLES(OVERALL)
    /EMMEANS=TABLES(time) COMPARE ADJ(BONFERRONI)
    /EMMEANS=TABLES(condition) COMPARE ADJ(BONFERRONI)
    /EMMEANS=TABLES(time*condition)
    /TEST 'mean(c1,t1)' intercept 1 condition 1 0 time 1 0 0 condition*time 1 0 0 0 0 0
    /TEST 'mean(c1,t2)' intercept 1 condition 2 0 time 0 1 0 condition*time 0 1 0 0 0 0
    /TEST 'mean(c1,t3)' intercept 1 condition 1 0 time 0 0 1 condition*time 0 0 1 0 0 0
    /TEST 'mean(c2,t1)' intercept 1 condition 0 1 time 1 0 0 condition*time 0 0 0 1 0 0
    /TEST 'mean(c2,t2)' intercept 1 condition 0 1 time 0 1 0 condition*time 0 0 0 0 1 0
    /TEST 'mean(c2,t3)' intercept 1 condition 0 1 time 0 0 1 condition*time 0 0 0 0 0 1
    /TEST 'Diff1: mean(c1,t1) MINUS mean(c1,t2)' intercept 0 condition 0 0 time 1 -1 0 condition*time 1 -1 0 0 0 0
    /TEST 'Diff2: mean(c1,t1) MINUS mean(c1,t3)' intercept 0 condition 0 0 time 1 0 -1 condition*time 1 0 -1 0 0 0
    /TEST 'Diff3: mean(c1,t2) MINUS mean(c1,t3)' intercept 0 condition 0 0 time 0 1 -1 condition*time 0 1 -1 0 0 0
    /TEST 'Diff4: mean(c2,t1) MINUS mean(c2,t2)' intercept 0 condition 0 0 time 1 -1 0 condition*time 0 0 0 1 -1 0
    /TEST 'Diff5: mean(c2,t1) MINUS mean(c2,t3)' intercept 0 condition 0 0 time 1 0 -1 condition*time 0 0 0 1 0 -1
    /TEST 'Diff6: mean(c2,t2) MINUS mean(c2,t3)' intercept 0 condition 0 0 time 0 1 -1 condition*time 0 0 0 0 1 -1
    /TEST 'Diff1 MINUS Diff4' intercept 0 condition 0 0 time 0 0 0 condition*time 1 -1 0 -1 1 0
    /TEST 'Diff2 MINUS Diff5' intercept 0 condition 0 0 time 0 0 0 condition*time 1 0 -1 -1 0 1
    /TEST 'Diff3 MINUS Diff6' intercept 0 condition 0 0 time 0 0 0 condition*time 0 1 -1 0 -1 1.

    The problem is that the program runs the first /test (meanc1,t2) and the (mean(c2,t3), but not the others. 
    The following error appeared: Custom hypothesis test 2 (mean(c1,t2)) will not be performed because the L matrix is not estimable. It seems that I need to do something before the /tests but i have no ideia what i should do...
    I only saw LMATRIX subcommands for GLM.. I also have the same database in wide form but i dont know if it is possible to work with both forms...

    Thank you for you help!

    ------------------------------
    Catarina Nunes
    ------------------------------

    #SPSSStatistics