I would like to use SPSS to replicate a linear mixed model that was
originally computed using SAS. The data are from a clinical trial where a new treatment is supposed to modify the decline slope of the outcome of interest as compared to standard treatment. The SAS code that was used looks like this: proc mixed data=xyz model outcome=slope_a slope_b/s cl; random intercept/subject=patient type=un; contrast "Difference Postrand slopes" slope_a 1 slope_b 1; 'outcome' is the outcome of interest and 'slope_a' and 'slope_b' represent the number of days since baseline at which 'outcome' was measured for patients in group A and group B, respectively. For patients in group A, 'slope_b' is always zero, and vice versa. How can I recreate this in SPSS? Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
I don't use sas so I can only guess at the meaning of the model statement. To help, would you describe more fully the dataset to which the analysis model is to be applied. You said: two groups, clinical trial, presumptively random assignment. Was outcome measured multiple times (I know this seems odd to ask, maybe, but indulge me please)? The element that seems to be missing is a categorical variable for treatment assignment. Does the source article say anything about this?
It seems to me that a possible translation (ignoring the sas contrast statement) is Mixed outcome with time/fixed=time/random intercept  subject(patient) covtype=id. However, I'd use this statement Mixed outcome by group with time/fixed=group time group*time/random intercept  subject(patient) covtype=id. Gene Maguin Original Message From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of AndreasV Sent: Thursday, October 19, 2017 1:59 PM To: [hidden email] Subject: Linear mixed model syntax help needed (SAS to SPSS) I would like to use SPSS to replicate a linear mixed model that was originally computed using SAS. The data are from a clinical trial where a new treatment is supposed to modify the decline slope of the outcome of interest as compared to standard treatment. The SAS code that was used looks like this: proc mixed data=xyz model outcome=slope_a slope_b/s cl; random intercept/subject=patient type=un; contrast "Difference Postrand slopes" slope_a 1 slope_b 1; 'outcome' is the outcome of interest and 'slope_a' and 'slope_b' represent the number of days since baseline at which 'outcome' was measured for patients in group A and group B, respectively. For patients in group A, 'slope_b' is always zero, and vice versa. How can I recreate this in SPSS? Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by AndreasV
I am not that familiar with SAS code, but it seems as if the LMM procedure in SAS works with a wide format, i e the slopes are contained in two separate variables, one for each group. In SPSS, the format for LMM must be long  one variable for slope and another for group.
Robert Ursprungligt meddelande Från: SPSSX(r) Discussion [mailto:[hidden email]] För AndreasV Skickat: den 19 oktober 2017 19:59 Till: [hidden email] Ämne: Linear mixed model syntax help needed (SAS to SPSS) I would like to use SPSS to replicate a linear mixed model that was originally computed using SAS. The data are from a clinical trial where a new treatment is supposed to modify the decline slope of the outcome of interest as compared to standard treatment. The SAS code that was used looks like this: proc mixed data=xyz model outcome=slope_a slope_b/s cl; random intercept/subject=patient type=un; contrast "Difference Postrand slopes" slope_a 1 slope_b 1; 'outcome' is the outcome of interest and 'slope_a' and 'slope_b' represent the number of days since baseline at which 'outcome' was measured for patients in group A and group B, respectively. For patients in group A, 'slope_b' is always zero, and vice versa. How can I recreate this in SPSS? Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD
Robert Lundqvist

In reply to this post by Maguin, Eugene
I agree with Gene's code.
The UNstructured matrix specified in the linear mixed model written in SAS MIXED or SPSS MIXED will automatically reduce to an identity matrix since there are no additional random effects specified with which the random intercept term can covary. Any contrasts of interest can be reconstructed using the TEST subcommand in SPSS MIXED. Ryan Sent from my iPhone > On Oct 20, 2017, at 9:39 AM, Maguin, Eugene <[hidden email]> wrote: > > I don't use sas so I can only guess at the meaning of the model statement. To help, would you describe more fully the dataset to which the analysis model is to be applied. You said: two groups, clinical trial, presumptively random assignment. Was outcome measured multiple times (I know this seems odd to ask, maybe, but indulge me please)? The element that seems to be missing is a categorical variable for treatment assignment. Does the source article say anything about this? > > It seems to me that a possible translation (ignoring the sas contrast statement) is > > Mixed outcome with time/fixed=time/random intercept  subject(patient) covtype=id. > > However, I'd use this statement > > Mixed outcome by group with time/fixed=group time group*time/random intercept  subject(patient) covtype=id. > > Gene Maguin > > > Original Message > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of AndreasV > Sent: Thursday, October 19, 2017 1:59 PM > To: [hidden email] > Subject: Linear mixed model syntax help needed (SAS to SPSS) > > I would like to use SPSS to replicate a linear mixed model that was originally computed using SAS. The data are from a clinical trial where a new treatment is supposed to modify the decline slope of the outcome of interest as compared to standard treatment. The SAS code that was used looks like this: > > proc mixed data=xyz > model outcome=slope_a slope_b/s cl; > random intercept/subject=patient type=un; > contrast "Difference Postrand slopes" slope_a 1 slope_b 1; > > 'outcome' is the outcome of interest and 'slope_a' and 'slope_b' represent the number of days since baseline at which 'outcome' was measured for patients in group A and group B, respectively. For patients in group A, 'slope_b' is always zero, and vice versa. > > How can I recreate this in SPSS? > > Andreas > > > > >  > Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ > > ===================== > To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD > > ===================== > To manage your subscription to SPSSXL, send a message to > [hidden email] (not to SPSSXL), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSXL > For a list of commands to manage subscriptions, send the command > INFO REFCARD ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
I looked a bit more closely at the original code. The OP could directly estimate groupspecific slopes by specifying the following fixed effects:
group group*time ...while eliminating the intercept term (noint keyword). The group fixed effects would represent groupspecific intercepts and the group*time fixed effects would represent groupspecific slopes. This model would be equivalent to the usual parameterization: Group Time Group*time ...with the intercept term included. Further to Gene's point, all of this assumes the usual conditionBYtime design in which participants are assigned to groups and measured at least twice on the dependent variable. Might I add that if participants were measured more than twice, specifying a random intercept term only may not suffice. Ryan Sent from my iPhone > On Oct 20, 2017, at 12:12 PM, Ryan Black <[hidden email]> wrote: > > I agree with Gene's code. > > The UNstructured matrix specified in the linear mixed model written in SAS MIXED or SPSS MIXED will automatically reduce to an identity matrix since there are no additional random effects specified with which the random intercept term can covary. > > Any contrasts of interest can be reconstructed using the TEST subcommand in SPSS MIXED. > > Ryan > > Sent from my iPhone > >> On Oct 20, 2017, at 9:39 AM, Maguin, Eugene <[hidden email]> wrote: >> >> I don't use sas so I can only guess at the meaning of the model statement. To help, would you describe more fully the dataset to which the analysis model is to be applied. You said: two groups, clinical trial, presumptively random assignment. Was outcome measured multiple times (I know this seems odd to ask, maybe, but indulge me please)? The element that seems to be missing is a categorical variable for treatment assignment. Does the source article say anything about this? >> >> It seems to me that a possible translation (ignoring the sas contrast statement) is >> >> Mixed outcome with time/fixed=time/random intercept  subject(patient) covtype=id. >> >> However, I'd use this statement >> >> Mixed outcome by group with time/fixed=group time group*time/random intercept  subject(patient) covtype=id. >> >> Gene Maguin >> >> >> Original Message >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of AndreasV >> Sent: Thursday, October 19, 2017 1:59 PM >> To: [hidden email] >> Subject: Linear mixed model syntax help needed (SAS to SPSS) >> >> I would like to use SPSS to replicate a linear mixed model that was originally computed using SAS. The data are from a clinical trial where a new treatment is supposed to modify the decline slope of the outcome of interest as compared to standard treatment. The SAS code that was used looks like this: >> >> proc mixed data=xyz >> model outcome=slope_a slope_b/s cl; >> random intercept/subject=patient type=un; >> contrast "Difference Postrand slopes" slope_a 1 slope_b 1; >> >> 'outcome' is the outcome of interest and 'slope_a' and 'slope_b' represent the number of days since baseline at which 'outcome' was measured for patients in group A and group B, respectively. For patients in group A, 'slope_b' is always zero, and vice versa. >> >> How can I recreate this in SPSS? >> >> Andreas >> >> >> >> >>  >> Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ >> >> ===================== >> To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD >> >> ===================== >> To manage your subscription to SPSSXL, send a message to >> [hidden email] (not to SPSSXL), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSXL >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by AndreasV
Thanks for all your thoughts! I have meanwhile been able to replicate the
results in SPSS, and I have found that proc mixed data=xyz model outcome=slope_a slope_b/s cl; random intercept/subject=patient type=un; contrast "Difference Postrand slopes" slope_a 1 slope_b 1; apparently translates to mixed outcome with slope_a slope_b /fixed=slope_a slope_b /random=intercept  subject(patient) covtype(un) /print=solution testcov /test="Difference postrandomization slopes" slope_a 1 slope_b 1. in SPSS  both statements provide identical results. @ Gene: The data are from a randomized trial with two parallel groups, A and B. There are multiple (>3) postbaseline assessments of the outcome, but the number of data points differs from subject to subject. @ All: Yes, I have also been wondering why there is no Group variable in the model. The purpose of the analysis is to determine the postrandomization slopes for treatments A and B, and to test whether they are different (assuming that Treatment A is Standard of Care or a placebo, we want to know whether Treatment B modifies the course of the outcome of interest). So we would like to know the linear slopes (and their confidence intervals) for treatmente A and B, the difference between the slopes, and the associated significance test. As usual, there is one record of data per measurement for each subject. The authors of the SAS code have recorded the number of days between baseline and the postbaseline measurement in variable slope_a for subjects treated with A and in slope_b for subjects treated with B. For subjects in group A, slope_b is always zero, and vice versa. Do you think that the current approach is correct? Or should this have been coded differently? @ Ryan: There is another version of the SAS code that includes a random slope in addition to the random intercept. I have meanwhile been able to recreate this in SPSS as well; however, the original purpose of my post here was to get som advice on how to translate the SAS code into SPSS, and therefore I have posted the 'simpler' version. Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
I still think there is something wrong with the model setup since LMM in SPSS
needs data in a long format. The variables slope_a and slope contain the number of days, don't they? Then there should be a variable for days and another for group as far as I can see. In syntax terms: MIXED outcome BY group WITH days /FIXED=group days /RANDOM=intercept  subject(patient) covtype(un) /PRINT=solution testcov. Robert  Robert Lundqvist  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD
Robert Lundqvist

Robert L wrote
> MIXED outcome BY group WITH days > /FIXED=group days > /RANDOM=intercept  subject(patient) covtype(un) > /PRINT=solution testcov. ... this, however, does not give you the slopes for the the two treatment groups, does it? The alternative to be demonstrated is that the groups' slopes are different. As I understand the syntax above, it tests whether the groups differ with respect their average outcome, controlling for days. This seems to be something else, isn't it? Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
All: Both SPSS and SAS require data with repeated measurements structured in vertical (long) format to employ the respective MIXED procedures.
Andreas: In my previous message I provided you with the solution (or so I thought), using two parameterizations of the same model. The fixed effects component of the model would typically include group, time, and group*time. The test on the interaction addresses the differential slope question. You could construct TEST statements to estimate and test the groupspecific slopes. You might consider providing an illustration of the dataset if you think there is a misunderstanding. Ryan Sent from my iPhone On Oct 28, 2017, at 4:16 PM, AndreasV <[hidden email]> wrote: >> MIXED outcome BY group WITH days >> /FIXED=group days >> /RANDOM=intercept  subject(patient) covtype(un) >> /PRINT=solution testcov. ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by AndreasV
OK, so you want to test the possibility of different slopes? I would add an interaction term for group*day:
/FIXED=group days group*days Robert Ursprungligt meddelande Från: SPSSX(r) Discussion [mailto:[hidden email]] För AndreasV Skickat: den 28 oktober 2017 22:17 Till: [hidden email] Ämne: Re: Linear mixed model syntax help needed (SAS to SPSS) Robert L wrote > MIXED outcome BY group WITH days > /FIXED=group days > /RANDOM=intercept  subject(patient) covtype(un) /PRINT=solution > testcov. ... this, however, does not give you the slopes for the the two treatment groups, does it? The alternative to be demonstrated is that the groups' slopes are different. As I understand the syntax above, it tests whether the groups differ with respect their average outcome, controlling for days. This seems to be something else, isn't it? Andreas  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD
Robert Lundqvist

Free forum by Nabble  Edit this page 