|
Hello All,
Bleow is a SAS code that runs a mixed model for repeated measure data, which runs smoothly. The "esitmate" function can produce the paired comparison based on the mixed model. In SPSS, I can do the mixed model and got the same estimates, but I do not know how to produce the paired comparisons like the SAS "estimate" does. Does anyone know how to do this in SPSS? Thank you Rongjin Guan SSW, Rutgers Univ. proc mixed data=new method = reml; class time ID; model Measure = time /s; repeated /type = ar(1) subject=ID r; lsmeans time/ alpha=0.05; estimate "Time2 vs Time1" time -1 1 0 0/cl; estimate " Time3 vs Time1" time -1 0 1 0/cl; estimate " Time4 vs Time1" time -1 0 0 1/cl; estimate "Time3 vs Time2" time 0 -1 1 0/cl; estimate " Time4 vs Time2" time 0 -1 0 1/cl; estimate " Time4 vs Time3" time 0 0 -1 1/cl; run; ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
It is dangerous to fit a model without specifying the within-subjects variable on the REPEATED statement using the MIXED procedure in SAS. SAS assumes your data are sorted correctly without the within-subjects variable. Consequently, to be on the safe side I would recommend you change your REPEATED statement from: repeated /type = ar(1) subject=ID r; to: repeated time /type = ar(1) subject=ID r; To answer your question, you can obtain the same contrasts in SPSS using the TEST sub-command, i.e., /TEST 'Time 2 versus Time 1' time -1 1 0 0 Ryan On Fri, Sep 18, 2015 at 3:18 PM, Rongjin Guan <[hidden email]> wrote: Hello All, |
|
Hi Ryan
Thank you very much. I will give it a try and compare. Have a nice weekend Rongjin ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Ryan Black [[hidden email]] Sent: Friday, September 18, 2015 3:33 PM To: [hidden email] Subject: Re: SPSS repeated measure: how to do paired comparison? It is dangerous to fit a model without specifying the within-subjects variable on the REPEATED statement using the MIXED procedure in SAS. SAS assumes your data are sorted correctly without the within-subjects variable. Consequently, to be on the safe side I would recommend you change your REPEATED statement from: repeated /type = ar(1) subject=ID r; to: repeated time /type = ar(1) subject=ID r; To answer your question, you can obtain the same contrasts in SPSS using the TEST sub-command, i.e., /TEST 'Time 2 versus Time 1' time -1 1 0 0 Ryan On Fri, Sep 18, 2015 at 3:18 PM, Rongjin Guan <[hidden email]<mailto:[hidden email]>> wrote: Hello All, Bleow is a SAS code that runs a mixed model for repeated measure data, which runs smoothly. The "esitmate" function can produce the paired comparison based on the mixed model. In SPSS, I can do the mixed model and got the same estimates, but I do not know how to produce the paired comparisons like the SAS "estimate" does. Does anyone know how to do this in SPSS? Thank you Rongjin Guan SSW, Rutgers Univ. proc mixed data=new method = reml; class time ID; model Measure = time /s; repeated /type = ar(1) subject=ID r; lsmeans time/ alpha=0.05; estimate "Time2 vs Time1" time -1 1 0 0/cl; estimate " Time3 vs Time1" time -1 0 1 0/cl; estimate " Time4 vs Time1" time -1 0 0 1/cl; estimate "Time3 vs Time2" time 0 -1 1 0/cl; estimate " Time4 vs Time2" time 0 -1 0 1/cl; estimate " Time4 vs Time3" time 0 0 -1 1/cl; run; ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Ryan
Hi Ryan
I have several more questions: 1. when I used the following syntax, I got each comparison in individual tables, but in SAS, these comparisons are grouped in the same table. Is SPSS, is there a way to group those test output into a single table? MIXED lstgmb BY Time /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED=Time | SSTYPE(3) /METHOD=REML /PRINT= SOLUTION /REPEATED=Time | SUBJECT(ClientID) COVTYPE(AR1) /TEST 'Time 2 versus Time 1' Time -1 1 0 0 /TEST 'Time 3 versus Time 1' time -1 0 1 0 TEST 'Time 4 versus Time 1' time -1 0 0 1 /TEST 'Time 3 versus Time 2' time 0 -1 1 0 /TEST 'Time 4 versus Time 2' time 0 -1 0 1 /TEST 'Time 4 versus Time 3' time 0 0 -1 1 2. Although the T-values, p values are all the same between SAS and SPSS output, the DFs are different for example, in SAS, the DF for all the comparison is 178, and in SPSS, each comparison has a different df value, not an integer, like 207.854. I do not know which DF to report. Do you have any idea about this? 3. How to choose the covariance structure type? I used AR(1). There are many different choices. Thank you Rongjin ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Ryan Black [[hidden email]] Sent: Friday, September 18, 2015 3:33 PM To: [hidden email] Subject: Re: SPSS repeated measure: how to do paired comparison? It is dangerous to fit a model without specifying the within-subjects variable on the REPEATED statement using the MIXED procedure in SAS. SAS assumes your data are sorted correctly without the within-subjects variable. Consequently, to be on the safe side I would recommend you change your REPEATED statement from: repeated /type = ar(1) subject=ID r; to: repeated time /type = ar(1) subject=ID r; To answer your question, you can obtain the same contrasts in SPSS using the TEST sub-command, i.e., /TEST 'Time 2 versus Time 1' time -1 1 0 0 Ryan On Fri, Sep 18, 2015 at 3:18 PM, Rongjin Guan <[hidden email]<mailto:[hidden email]>> wrote: Hello All, Bleow is a SAS code that runs a mixed model for repeated measure data, which runs smoothly. The "esitmate" function can produce the paired comparison based on the mixed model. In SPSS, I can do the mixed model and got the same estimates, but I do not know how to produce the paired comparisons like the SAS "estimate" does. Does anyone know how to do this in SPSS? Thank you Rongjin Guan SSW, Rutgers Univ. proc mixed data=new method = reml; class time ID; model Measure = time /s; repeated /type = ar(1) subject=ID r; lsmeans time/ alpha=0.05; estimate "Time2 vs Time1" time -1 1 0 0/cl; estimate " Time3 vs Time1" time -1 0 1 0/cl; estimate " Time4 vs Time1" time -1 0 0 1/cl; estimate "Time3 vs Time2" time 0 -1 1 0/cl; estimate " Time4 vs Time2" time 0 -1 0 1/cl; estimate " Time4 vs Time3" time 0 0 -1 1/cl; run; ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
I'd like comment only on #3.
Each choice implies a set of assumptions about the residual covariance matrix in terms of the number of non-zero values and a possible algebraic relationship between/among values. Together, those two elements define the number of parameters for the repeated effects shown in the model dimensions table. As someone somewhat recently pointed out, models can be compared by means of the difference in the log likelihoods against the difference in the degrees of freedom, i.e., number of parameters, for each model. (In a structural equation model, an added requirement is that the two models be nested. I don't know if that applies here.) The difficulty--and this may be the problem that you encounter--is that some residual covariance assumptions may imply the same number of parameters for a specific within structure. Others may be more knowledgeable but all you have for decision criteria are the information criteria numbers. Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rongjin Guan Sent: Wednesday, September 23, 2015 2:38 PM To: [hidden email] Subject: Re: SPSS repeated measure: how to do paired comparison? Hi Ryan I have several more questions: 1. when I used the following syntax, I got each comparison in individual tables, but in SAS, these comparisons are grouped in the same table. Is SPSS, is there a way to group those test output into a single table? MIXED lstgmb BY Time /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED=Time | SSTYPE(3) /METHOD=REML /PRINT= SOLUTION /REPEATED=Time | SUBJECT(ClientID) COVTYPE(AR1) /TEST 'Time 2 versus Time 1' Time -1 1 0 0 /TEST 'Time 3 versus Time 1' time -1 0 1 0 TEST 'Time 4 versus Time 1' time -1 0 0 1 /TEST 'Time 3 versus Time 2' time 0 -1 1 0 /TEST 'Time 4 versus Time 2' time 0 -1 0 1 /TEST 'Time 4 versus Time 3' time 0 0 -1 1 2. Although the T-values, p values are all the same between SAS and SPSS output, the DFs are different for example, in SAS, the DF for all the comparison is 178, and in SPSS, each comparison has a different df value, not an integer, like 207.854. I do not know which DF to report. Do you have any idea about this? 3. How to choose the covariance structure type? I used AR(1). There are many different choices. Thank you Rongjin ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Ryan Black [[hidden email]] Sent: Friday, September 18, 2015 3:33 PM To: [hidden email] Subject: Re: SPSS repeated measure: how to do paired comparison? It is dangerous to fit a model without specifying the within-subjects variable on the REPEATED statement using the MIXED procedure in SAS. SAS assumes your data are sorted correctly without the within-subjects variable. Consequently, to be on the safe side I would recommend you change your REPEATED statement from: repeated /type = ar(1) subject=ID r; to: repeated time /type = ar(1) subject=ID r; To answer your question, you can obtain the same contrasts in SPSS using the TEST sub-command, i.e., /TEST 'Time 2 versus Time 1' time -1 1 0 0 Ryan On Fri, Sep 18, 2015 at 3:18 PM, Rongjin Guan <[hidden email]<mailto:[hidden email]>> wrote: Hello All, Bleow is a SAS code that runs a mixed model for repeated measure data, which runs smoothly. The "esitmate" function can produce the paired comparison based on the mixed model. In SPSS, I can do the mixed model and got the same estimates, but I do not know how to produce the paired comparisons like the SAS "estimate" does. Does anyone know how to do this in SPSS? Thank you Rongjin Guan SSW, Rutgers Univ. proc mixed data=new method = reml; class time ID; model Measure = time /s; repeated /type = ar(1) subject=ID r; lsmeans time/ alpha=0.05; estimate "Time2 vs Time1" time -1 1 0 0/cl; estimate " Time3 vs Time1" time -1 0 1 0/cl; estimate " Time4 vs Time1" time -1 0 0 1/cl; estimate "Time3 vs Time2" time 0 -1 1 0/cl; estimate " Time4 vs Time2" time 0 -1 0 1/cl; estimate " Time4 vs Time3" time 0 0 -1 1/cl; run; ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email]<mailto:[hidden email]> (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
