Problem specifying MIXED model with heterogeneous variances

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
I apologize up front for the length & complexity of this post.  Anyone who decides to read it seriously is advised to have a cup (or maybe a pot) of strong coffee at the ready!  ;-)

I've been reading this article by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide here.  

Table 3 in the article shows 3 models for analysis of data with repeated measures:

2A - Main effects only with homogeneous variances
2B - Main effects only with heterogeneous variances
3B - Main effects & selected interactions with heterogeneous variances

The SPSS syntax for these models is found in file MLM_AppendixA.sps (which is in the .zip from the link given above).  Before anyone freaks out, let me point out that the data management steps in that syntax file could have been done a lot more efficiently.  ;-)  But that's not what I'm asking about.  

Here is the MIXED command they used to run model 2A above (note that they had command terminators on both /RANDOM sub-commands, and I had to remove the first one to get the model to run):

MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
  /FIXED  = c_mean c_sal oldage yrs65
  /METHOD = ML
  /PRINT  = SOLUTION TESTCOV R
  /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
  /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
.

The results from this command are very close to those reported in Table 3 of the article.  

Now here's the bit that prompts my question:  A comment in the syntax file says that "SPSS will not allow heterogeneous errors", and therefore, no attempt is made to fit model 2B.  However, it seemed to me that with an appropriate /REPEATED sub-command, one should be able to fit model 2B.  After a little tinkering around, I came up with this syntax:

TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
  /FIXED  = c_mean c_sal oldage yrs65
  /METHOD = ML
  /PRINT  = SOLUTION TESTCOV R
  /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
  /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)
.

This is giving me results that are very similar to the Model 2B results in Table 3 of the article, but it's not quite right.  Notice that H&R's Model 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So I'm missing something, but I can't figure out what it is.  

Ryan, I hope you're reading this--maybe you can spot it.  In case it helps, here is the SAS code to run the same model--I assume the results reported in Table 3 are from SAS.

TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
   CLASS ID Item older;
   MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
   RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
   RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
   REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;

One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED line.  I assume TYPE refers to the covariance structure, and VC means variance components.  AFAIK, the MIXED command in SPSS does not allow COVTYPE=VC on the /REPEATED line.  From the FM:

"If the variance components structure is specified on the REPEATED subcommand, it is replaced by the
diagonal (DIAG) structure."

So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?  Or is it something else about my /REPEATED line?  

I apologize again for posting such a long & complicated question--but I don't like seeing authors who don't use SPSS writing comments like "SPSS will not allow heterogeneous errors" when in fact it will!  So I'd like to figure this out and let them know how to do it.  ;-)

Cheers,
Bruce

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Ryan
Hi Bruce,
 
One thing that immediately stands out to me is that the second RANDOM statement in the SPSS MIXED code does not estimate "oldage"-specific covariance parameters. OTOH, the SAS MIXED code specifies "oldage"-specific covariance parameters by including the keyword "GROUP=" which increases the number of parameters being estimated by one, since there are presumably two age groups. 
 
Ryan

On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <[hidden email]> wrote:
I apologize up front for the length & complexity of this post.  Anyone who
decides to read it seriously is advised to have a cup (or maybe a pot) of
strong coffee at the ready!  ;-)

I've been reading  this article
<http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
here
<http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>  .

Table 3 in the article shows 3 models for analysis of data with repeated
measures:

2A - Main effects only with homogeneous variances
2B - Main effects only with heterogeneous variances
3B - Main effects & selected interactions with heterogeneous variances

The SPSS syntax for these models is found in file /MLM_AppendixA.sps/ (which
is in the .zip from the link given above).  Before anyone freaks out, let me
point out that the data management steps in that syntax file could have been
done a lot more efficiently.  ;-)  But that's not what I'm asking about.

Here is the MIXED command they used to run model 2A above (note that they
had command terminators on both /RANDOM sub-commands, and I had to remove
the first one to get the model to run):

MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
  /FIXED  = c_mean c_sal oldage yrs65
  /METHOD = ML
  /PRINT  = SOLUTION TESTCOV R
  /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
  /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
.

The results from this command are very close to those reported in Table 3 of
the article.

Now here's the bit that prompts my question:  A comment in the syntax file
says that "SPSS will not allow heterogeneous errors", and therefore, no
attempt is made to fit model 2B.  However, it seemed to me that with an
appropriate /REPEATED sub-command, one should be able to fit model 2B.
After a little tinkering around, I came up with this syntax:

TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
  /FIXED  = c_mean c_sal oldage yrs65
  /METHOD = ML
  /PRINT  = SOLUTION TESTCOV R
  /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
  /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
*  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
.

This is giving me results that are very similar to the Model 2B results in
Table 3 of the article, but it's not quite right.  Notice that H&R's Model
2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
I'm missing something, but I can't figure out what it is.

Ryan, I hope you're reading this--maybe you can spot it.  In case it helps,
here is the SAS code to run the same model--I assume the results reported in
Table 3 are from SAS.

TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
   CLASS ID Item older;
   MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
   RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
   RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
   REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;

One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
line.  I assume TYPE refers to the covariance structure, and VC means
variance components.  AFAIK, the MIXED command in SPSS does not allow
COVTYPE=VC on the /REPEATED line.  From the FM:

"If the variance components structure is specified on the REPEATED
subcommand, it is replaced by the
diagonal (DIAG) structure."

So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?  Or
is it something else about my /REPEATED line?

I apologize again for posting such a long & complicated question--but I
don't like seeing authors who don't use SPSS writing comments like "SPSS
will not allow heterogeneous errors" when in fact it will!  So I'd like to
figure this out and let them know how to do it.  ;-)

Cheers,
Bruce





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
Thanks Ryan.  I may be missing the obvious, but how would you specify the model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter of changing the second /RANDOM line from

  /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
  /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?


Ryan Black wrote
Hi Bruce,
 
One thing that immediately stands out to me is that the second RANDOM statement in the SPSS MIXED code does not estimate "oldage"-specific covariance parameters. OTOH, the SAS MIXED code specifies "oldage"-specific covariance parameters by including the keyword "GROUP=" which increases the number of parameters being estimated by one, since there are presumably two age groups.
 
Ryan

> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <[hidden email]> wrote:
> I apologize up front for the length & complexity of this post.  Anyone who
> decides to read it seriously is advised to have a cup (or maybe a pot) of
> strong coffee at the ready!  ;-)
>
> I've been reading  this article
> <http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
> here
> <http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>  .
>
> Table 3 in the article shows 3 models for analysis of data with repeated
> measures:
>
> 2A - Main effects only with homogeneous variances
> 2B - Main effects only with heterogeneous variances
> 3B - Main effects & selected interactions with heterogeneous variances
>
> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/ (which
> is in the .zip from the link given above).  Before anyone freaks out, let me
> point out that the data management steps in that syntax file could have been
> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
>
> Here is the MIXED command they used to run model 2A above (note that they
> had command terminators on both /RANDOM sub-commands, and I had to remove
> the first one to get the model to run):
>
> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>   /FIXED  = c_mean c_sal oldage yrs65
>   /METHOD = ML
>   /PRINT  = SOLUTION TESTCOV R
>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> .
>
> The results from this command are very close to those reported in Table 3 of
> the article.
>
> Now here's the bit that prompts my question:  A comment in the syntax file
> says that "SPSS will not allow heterogeneous errors", and therefore, no
> attempt is made to fit model 2B.  However, it seemed to me that with an
> appropriate /REPEATED sub-command, one should be able to fit model 2B.
> After a little tinkering around, I came up with this syntax:
>
> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>   /FIXED  = c_mean c_sal oldage yrs65
>   /METHOD = ML
>   /PRINT  = SOLUTION TESTCOV R
>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
> .
>
> This is giving me results that are very similar to the Model 2B results in
> Table 3 of the article, but it's not quite right.  Notice that H&R's Model
> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
> I'm missing something, but I can't figure out what it is.
>
> Ryan, I hope you're reading this--maybe you can spot it.  In case it helps,
> here is the SAS code to run the same model--I assume the results reported in
> Table 3 are from SAS.
>
> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>    CLASS ID Item older;
>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>
> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
> line.  I assume TYPE refers to the covariance structure, and VC means
> variance components.  AFAIK, the MIXED command in SPSS does not allow
> COVTYPE=VC on the /REPEATED line.  From the FM:
>
> "If the variance components structure is specified on the REPEATED
> subcommand, it is replaced by the
> diagonal (DIAG) structure."
>
> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?  Or
> is it something else about my /REPEATED line?
>
> I apologize again for posting such a long & complicated question--but I
> don't like seeing authors who don't use SPSS writing comments like "SPSS
> will not allow heterogeneous errors" when in fact it will!  So I'd like to
> figure this out and let them know how to do it.  ;-)
>
> Cheers,
> Bruce
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Alex Reutter
Yes; I would look at the GROUPING keyword on the RANDOM subcommand: http://pic.dhe.ibm.com/infocenter/spssstat/v22r0m0/topic/com.ibm.spss.statistics.reference/spss/advanced/syn_genlinmixed.htm





From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        11/25/2013 10:31 AM
Subject:        Re: Problem specifying MIXED model with heterogeneous variances
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thanks Ryan.  I may be missing the obvious, but how would you specify the
model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
of changing the second /RANDOM line from

       /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
       /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM
subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?



Ryan Black wrote
> Hi Bruce,
>
> One thing that immediately stands out to me is that the second RANDOM
> statement in the SPSS MIXED code does not estimate "oldage"-specific
> covariance parameters. OTOH, the SAS MIXED code specifies
> "oldage"-specific covariance parameters by including the keyword "GROUP="
> which increases the number of parameters being estimated by one, since
> there are presumably two age groups.
>
> Ryan
>
>> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver &lt;

> bruce.weaver@

> &gt; wrote:
>> I apologize up front for the length & complexity of this post.  Anyone
>> who
>> decides to read it seriously is advised to have a cup (or maybe a pot) of
>> strong coffee at the ready!  ;-)
>>
>> I've been reading  this article
>> &lt;
http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&amp;context=psychfacpub&gt;
>> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
>> here
>> &lt;
http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip&gt;
>> .
>>
>> Table 3 in the article shows 3 models for analysis of data with repeated
>> measures:
>>
>> 2A - Main effects only with homogeneous variances
>> 2B - Main effects only with heterogeneous variances
>> 3B - Main effects & selected interactions with heterogeneous variances
>>
>> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
>> (which
>> is in the .zip from the link given above).  Before anyone freaks out, let
>> me
>> point out that the data management steps in that syntax file could have
>> been
>> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
>>
>> Here is the MIXED command they used to run model 2A above (note that they
>> had command terminators on both /RANDOM sub-commands, and I had to remove
>> the first one to get the model to run):
>>
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> .
>>
>> The results from this command are very close to those reported in Table 3
>> of
>> the article.
>>
>> Now here's the bit that prompts my question:  A comment in the syntax
>> file
>> says that "SPSS will not allow heterogeneous errors", and therefore, no
>> attempt is made to fit model 2B.  However, it seemed to me that with an
>> appropriate /REPEATED sub-command, one should be able to fit model 2B.
>> After a little tinkering around, I came up with this syntax:
>>
>> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
>> .
>>
>> This is giving me results that are very similar to the Model 2B results
>> in
>> Table 3 of the article, but it's not quite right.  Notice that H&R's
>> Model
>> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
>> I'm missing something, but I can't figure out what it is.
>>
>> Ryan, I hope you're reading this--maybe you can spot it.  In case it
>> helps,
>> here is the SAS code to run the same model--I assume the results reported
>> in
>> Table 3 are from SAS.
>>
>> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
>> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>>    CLASS ID Item older;
>>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
>>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>>
>> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
>> line.  I assume TYPE refers to the covariance structure, and VC means
>> variance components.  AFAIK, the MIXED command in SPSS does not allow
>> COVTYPE=VC on the /REPEATED line.  From the FM:
>>
>> "If the variance components structure is specified on the REPEATED
>> subcommand, it is replaced by the
>> diagonal (DIAG) structure."
>>
>> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
>> Or
>> is it something else about my /REPEATED line?
>>
>> I apologize again for posting such a long & complicated question--but I
>> don't like seeing authors who don't use SPSS writing comments like "SPSS
>> will not allow heterogeneous errors" when in fact it will!  So I'd like
>> to
>> figure this out and let them know how to do it.  ;-)
>>
>> Cheers,
>> Bruce
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>>
http://sites.google.com/a/lakeheadu.ca/bweaver/
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> View this message in context:
>>
http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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


Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
Thanks Alex.  A bunch of other stuff has cropped up, so I have to set this problem aside for a bit.  But I'll certainly take a look at GENLINMIXED when I do come back to it.

Cheers,
Bruce


Alex Reutter wrote
Yes; I would look at the GROUPING keyword on the RANDOM subcommand:
http://pic.dhe.ibm.com/infocenter/spssstat/v22r0m0/topic/com.ibm.spss.statistics.reference/spss/advanced/syn_genlinmixed.htm





From:   Bruce Weaver <[hidden email]>
To:     [hidden email],
Date:   11/25/2013 10:31 AM
Subject:        Re: Problem specifying MIXED model with heterogeneous
variances
Sent by:        "SPSSX(r) Discussion" <[hidden email]>



Thanks Ryan.  I may be missing the obvious, but how would you specify the
model run by that SAS code in SPSS MIXED syntax?  It is not a simple
matter
of changing the second /RANDOM line from

        /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
        /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM
subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?



Ryan Black wrote
> Hi Bruce,
>
> One thing that immediately stands out to me is that the second RANDOM
> statement in the SPSS MIXED code does not estimate "oldage"-specific
> covariance parameters. OTOH, the SAS MIXED code specifies
> "oldage"-specific covariance parameters by including the keyword
"GROUP="
> which increases the number of parameters being estimated by one, since
> there are presumably two age groups.
>
> Ryan
>
>> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <

> bruce.weaver@

> > wrote:
>> I apologize up front for the length & complexity of this post.  Anyone
>> who
>> decides to read it seriously is advised to have a cup (or maybe a pot)
of
>> strong coffee at the ready!  ;-)
>>
>> I've been reading  this article
>> <
http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
;
>> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
>> here
>> <
http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
;
>> .
>>
>> Table 3 in the article shows 3 models for analysis of data with
repeated
>> measures:
>>
>> 2A - Main effects only with homogeneous variances
>> 2B - Main effects only with heterogeneous variances
>> 3B - Main effects & selected interactions with heterogeneous variances
>>
>> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
>> (which
>> is in the .zip from the link given above).  Before anyone freaks out,
let
>> me
>> point out that the data management steps in that syntax file could have
>> been
>> done a lot more efficiently.  ;-)  But that's not what I'm asking
about.
>>
>> Here is the MIXED command they used to run model 2A above (note that
they
>> had command terminators on both /RANDOM sub-commands, and I had to
remove
>> the first one to get the model to run):
>>
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> .
>>
>> The results from this command are very close to those reported in Table
3
>> of
>> the article.
>>
>> Now here's the bit that prompts my question:  A comment in the syntax
>> file
>> says that "SPSS will not allow heterogeneous errors", and therefore, no
>> attempt is made to fit model 2B.  However, it seemed to me that with an
>> appropriate /REPEATED sub-command, one should be able to fit model 2B.
>> After a little tinkering around, I came up with this syntax:
>>
>> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
>> .
>>
>> This is giving me results that are very similar to the Model 2B results
>> in
>> Table 3 of the article, but it's not quite right.  Notice that H&R's
>> Model
>> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.
So
>> I'm missing something, but I can't figure out what it is.
>>
>> Ryan, I hope you're reading this--maybe you can spot it.  In case it
>> helps,
>> here is the SAS code to run the same model--I assume the results
reported
>> in
>> Table 3 are from SAS.
>>
>> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
>> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>>    CLASS ID Item older;
>>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION
DDFM=Satterthwaite;
>>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>>
>> One thing I do notice is that the SAS code shows TYPE=VC on the
REPEATED
>> line.  I assume TYPE refers to the covariance structure, and VC means
>> variance components.  AFAIK, the MIXED command in SPSS does not allow
>> COVTYPE=VC on the /REPEATED line.  From the FM:
>>
>> "If the variance components structure is specified on the REPEATED
>> subcommand, it is replaced by the
>> diagonal (DIAG) structure."
>>
>> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
>> Or
>> is it something else about my /REPEATED line?
>>
>> I apologize again for posting such a long & complicated question--but I
>> don't like seeing authors who don't use SPSS writing comments like
"SPSS
>> will not allow heterogeneous errors" when in fact it will!  So I'd like
>> to
>> figure this out and let them know how to do it.  ;-)
>>
>> Cheers,
>> Bruce
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> View this message in context:
>>
http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html

>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Ryan
In reply to this post by Bruce Weaver
Bruce,
 
The code BELOW my name produces 10 parameter estimates and standard errors that are virtually identical to those reported in the article for model 2b. Note that there is a separate variance component for each level of "oldage" from the second RANDOM statement as is specified in the SAS MIXED code.
 
Best,

Ryan
 
--

RECODE oldage (0=1) (1=0) INTO oldage2.
EXECUTE.
 
 MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65 oldage2
   /FIXED  = c_mean c_sal oldage yrs65
   /METHOD = ML
   /PRINT  = SOLUTION TESTCOV R G
   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(ID)
   /RANDOM = oldage oldage2 | SUBJECT(ID)
   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).
 


On Mon, Nov 25, 2013 at 10:28 AM, Bruce Weaver <[hidden email]> wrote:
Thanks Ryan.  I may be missing the obvious, but how would you specify the
model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
of changing the second /RANDOM line from

        /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
        /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM
subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?



Ryan Black wrote
> Hi Bruce,
>
> One thing that immediately stands out to me is that the second RANDOM
> statement in the SPSS MIXED code does not estimate "oldage"-specific
> covariance parameters. OTOH, the SAS MIXED code specifies
> "oldage"-specific covariance parameters by including the keyword "GROUP="
> which increases the number of parameters being estimated by one, since
> there are presumably two age groups.
>
> Ryan
>
>> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <

> bruce.weaver@

> > wrote:
>> I apologize up front for the length & complexity of this post.  Anyone
>> who
>> decides to read it seriously is advised to have a cup (or maybe a pot) of
>> strong coffee at the ready!  ;-)
>>
>> I've been reading  this article
>> <http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
>> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
>> here
>> <http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
>> .
>>
>> Table 3 in the article shows 3 models for analysis of data with repeated
>> measures:
>>
>> 2A - Main effects only with homogeneous variances
>> 2B - Main effects only with heterogeneous variances
>> 3B - Main effects & selected interactions with heterogeneous variances
>>
>> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
>> (which
>> is in the .zip from the link given above).  Before anyone freaks out, let
>> me
>> point out that the data management steps in that syntax file could have
>> been
>> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
>>
>> Here is the MIXED command they used to run model 2A above (note that they
>> had command terminators on both /RANDOM sub-commands, and I had to remove
>> the first one to get the model to run):
>>
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> .
>>
>> The results from this command are very close to those reported in Table 3
>> of
>> the article.
>>
>> Now here's the bit that prompts my question:  A comment in the syntax
>> file
>> says that "SPSS will not allow heterogeneous errors", and therefore, no
>> attempt is made to fit model 2B.  However, it seemed to me that with an
>> appropriate /REPEATED sub-command, one should be able to fit model 2B.
>> After a little tinkering around, I came up with this syntax:
>>
>> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
>> .
>>
>> This is giving me results that are very similar to the Model 2B results
>> in
>> Table 3 of the article, but it's not quite right.  Notice that H&R's
>> Model
>> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
>> I'm missing something, but I can't figure out what it is.
>>
>> Ryan, I hope you're reading this--maybe you can spot it.  In case it
>> helps,
>> here is the SAS code to run the same model--I assume the results reported
>> in
>> Table 3 are from SAS.
>>
>> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
>> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>>    CLASS ID Item older;
>>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
>>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>>
>> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
>> line.  I assume TYPE refers to the covariance structure, and VC means
>> variance components.  AFAIK, the MIXED command in SPSS does not allow
>> COVTYPE=VC on the /REPEATED line.  From the FM:
>>
>> "If the variance components structure is specified on the REPEATED
>> subcommand, it is replaced by the
>> diagonal (DIAG) structure."
>>
>> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
>> Or
>> is it something else about my /REPEATED line?
>>
>> I apologize again for posting such a long & complicated question--but I
>> don't like seeing authors who don't use SPSS writing comments like "SPSS
>> will not allow heterogeneous errors" when in fact it will!  So I'd like
>> to
>> figure this out and let them know how to do it.  ;-)
>>
>> Cheers,
>> Bruce
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Kornbrot, Diana
Re: Problem specifying MIXED model with heterogeneous variances Yes
One does not need to specify the subject variable as random as SPSS does this automatically
BUT  using covtype(diag) instead of covtype(un) brings in the very unrealisitc assumption of homigeneity of variaiance etc. One of the (in my view major) advantage of mixed is that the unstructured covariance matrix takes care of variance heterogeneity automatically. This is true even for between group designs, and very useful as only oneway does this [not GLM]
Best

diana


On 26/11/2013 03:01, "Ryan Black" <ryan.andrew.black@...> wrote:

Bruce,
 
The code BELOW my name produces 10 parameter estimates and standard errors that are virtually identical to those reported in the article for model 2b. Note that there is a separate variance component for each level of "oldage" from the second RANDOM statement as is specified in the SAS MIXED code.
 
Best,

Ryan
 
--

RECODE oldage (0=1) (1=0) INTO oldage2.
EXECUTE.
 
 MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65 oldage2
   /FIXED  = c_mean c_sal oldage yrs65
   /METHOD = ML
   /PRINT  = SOLUTION TESTCOV R G
   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(ID)
   /RANDOM = oldage oldage2 | SUBJECT(ID)
   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).
 


On Mon, Nov 25, 2013 at 10:28 AM, Bruce Weaver <bruce.weaver@...> wrote:
Thanks Ryan.  I may be missing the obvious, but how would you specify the
model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
of changing the second /RANDOM line from

        /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
        /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM
subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?



Ryan Black wrote
> Hi Bruce,
>
> One thing that immediately stands out to me is that the second RANDOM
> statement in the SPSS MIXED code does not estimate "oldage"-specific
> covariance parameters. OTOH, the SAS MIXED code specifies
> "oldage"-specific covariance parameters by including the keyword "GROUP="
> which increases the number of parameters being estimated by one, since
> there are presumably two age groups.
>
> Ryan
>
>> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <

> bruce.weaver@

> > wrote:
>> I apologize up front for the length & complexity of this post.  Anyone
>> who
>> decides to read it seriously is advised to have a cup (or maybe a pot) of
>> strong coffee at the ready!  ;-)
>>
>> I've been reading  this article
>> <http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
>> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
>> here
>> <http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
>> .
>>
>> Table 3 in the article shows 3 models for analysis of data with repeated
>> measures:
>>
>> 2A - Main effects only with homogeneous variances
>> 2B - Main effects only with heterogeneous variances
>> 3B - Main effects & selected interactions with heterogeneous variances
>>
>> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
>> (which
>> is in the .zip from the link given above).  Before anyone freaks out, let
>> me
>> point out that the data management steps in that syntax file could have
>> been
>> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
>>
>> Here is the MIXED command they used to run model 2A above (note that they
>> had command terminators on both /RANDOM sub-commands, and I had to remove
>> the first one to get the model to run):
>>
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> .
>>
>> The results from this command are very close to those reported in Table 3
>> of
>> the article.
>>
>> Now here's the bit that prompts my question:  A comment in the syntax
>> file
>> says that "SPSS will not allow heterogeneous errors", and therefore, no
>> attempt is made to fit model 2B.  However, it seemed to me that with an
>> appropriate /REPEATED sub-command, one should be able to fit model 2B.
>> After a little tinkering around, I came up with this syntax:
>>
>> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
>> .
>>
>> This is giving me results that are very similar to the Model 2B results
>> in
>> Table 3 of the article, but it's not quite right.  Notice that H&R's
>> Model
>> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
>> I'm missing something, but I can't figure out what it is.
>>
>> Ryan, I hope you're reading this--maybe you can spot it.  In case it
>> helps,
>> here is the SAS code to run the same model--I assume the results reported
>> in
>> Table 3 are from SAS.
>>
>> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
>> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>>    CLASS ID Item older;
>>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
>>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>>
>> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
>> line.  I assume TYPE refers to the covariance structure, and VC means
>> variance components.  AFAIK, the MIXED command in SPSS does not allow
>> COVTYPE=VC on the /REPEATED line.  From the FM:
>>
>> "If the variance components structure is specified on the REPEATED
>> subcommand, it is replaced by the
>> diagonal (DIAG) structure."
>>
>> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
>> Or
>> is it something else about my /REPEATED line?
>>
>> I apologize again for posting such a long & complicated question--but I
>> don't like seeing authors who don't use SPSS writing comments like "SPSS
>> will not allow heterogeneous errors" when in fact it will!  So I'd like
>> to
>> figure this out and let them know how to do it.  ;-)
>>
>> Cheers,
>> Bruce
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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





-----
--
Bruce Weaver
bweaver@...
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (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




Professor Diana Kornbrot
email: : d.e.kornbrot@...
web:    http://dianakornbrot.wordpress.com/
            http://go.herts.ac.uk/diana_kornbrot
Work
Department of Psychology
School of Life and Medical Sciences
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
Home
19 Elmhurst Avenue
London N2 0LT, UK
voice:   +44 (0) 208  444 2081
mobile: +44 (0) 740 318 1612
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
In reply to this post by Ryan
Yes, that does it.  And just for completeness, COVTYPE = VC (the default for /RANDOM) on this line:

   /RANDOM = oldage oldage2 | SUBJECT(ID) COVTYPE(VC)

Thanks Ryan.  


Ryan Black wrote
Bruce,

The code BELOW my name produces 10 parameter estimates and standard errors
that are virtually identical to those reported in the article for model
2b. Note that there is a separate variance component for each level
of "oldage" from the second RANDOM statement as is specified in the SAS
MIXED code.

Best,

Ryan

--

RECODE oldage (0=1) (1=0) INTO oldage2.
EXECUTE.

 MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65 oldage2
   /FIXED  = c_mean c_sal oldage yrs65
   /METHOD = ML
   /PRINT  = SOLUTION TESTCOV R G
   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(ID)
   /RANDOM = oldage oldage2 | SUBJECT(ID)
   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).



On Mon, Nov 25, 2013 at 10:28 AM, Bruce Weaver <[hidden email]>wrote:

> Thanks Ryan.  I may be missing the obvious, but how would you specify the
> model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
> of changing the second /RANDOM line from
>
>         /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> to
>         /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)
>
> If I do that, the model won't run, and I get this warning:
>
> "The variables: oldage are specified both as subject variables in a RANDOM
> subcommand and as repeated measure variables in the REPEATED subcommand.
> Execution of this command stops."
>
> I wonder if life would be any easier trying this via GENLINMIXED?
>
>
>
> Ryan Black wrote
> > Hi Bruce,
> >
> > One thing that immediately stands out to me is that the second RANDOM
> > statement in the SPSS MIXED code does not estimate "oldage"-specific
> > covariance parameters. OTOH, the SAS MIXED code specifies
> > "oldage"-specific covariance parameters by including the keyword "GROUP="
> > which increases the number of parameters being estimated by one, since
> > there are presumably two age groups.
> >
> > Ryan
> >
> >> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <
>
> > bruce.weaver@
>
> > > wrote:
> >> I apologize up front for the length & complexity of this post.  Anyone
> >> who
> >> decides to read it seriously is advised to have a cup (or maybe a pot)
> of
> >> strong coffee at the ready!  ;-)
> >>
> >> I've been reading  this article
> >> <
> http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub
> >
> >> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
> >> here
> >> <
> http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
> >> .
> >>
> >> Table 3 in the article shows 3 models for analysis of data with repeated
> >> measures:
> >>
> >> 2A - Main effects only with homogeneous variances
> >> 2B - Main effects only with heterogeneous variances
> >> 3B - Main effects & selected interactions with heterogeneous variances
> >>
> >> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
> >> (which
> >> is in the .zip from the link given above).  Before anyone freaks out,
> let
> >> me
> >> point out that the data management steps in that syntax file could have
> >> been
> >> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
> >>
> >> Here is the MIXED command they used to run model 2A above (note that
> they
> >> had command terminators on both /RANDOM sub-commands, and I had to
> remove
> >> the first one to get the model to run):
> >>
> >> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
> >>   /FIXED  = c_mean c_sal oldage yrs65
> >>   /METHOD = ML
> >>   /PRINT  = SOLUTION TESTCOV R
> >>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
> >>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> >> .
> >>
> >> The results from this command are very close to those reported in Table
> 3
> >> of
> >> the article.
> >>
> >> Now here's the bit that prompts my question:  A comment in the syntax
> >> file
> >> says that "SPSS will not allow heterogeneous errors", and therefore, no
> >> attempt is made to fit model 2B.  However, it seemed to me that with an
> >> appropriate /REPEATED sub-command, one should be able to fit model 2B.
> >> After a little tinkering around, I came up with this syntax:
> >>
> >> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
> >> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
> >>   /FIXED  = c_mean c_sal oldage yrs65
> >>   /METHOD = ML
> >>   /PRINT  = SOLUTION TESTCOV R
> >>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
> >>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> >> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
> >> .
> >>
> >> This is giving me results that are very similar to the Model 2B results
> >> in
> >> Table 3 of the article, but it's not quite right.  Notice that H&R's
> >> Model
> >> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.
>  So
> >> I'm missing something, but I can't figure out what it is.
> >>
> >> Ryan, I hope you're reading this--maybe you can spot it.  In case it
> >> helps,
> >> here is the SAS code to run the same model--I assume the results
> reported
> >> in
> >> Table 3 are from SAS.
> >>
> >> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
> >> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
> >>    CLASS ID Item older;
> >>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION
> DDFM=Satterthwaite;
> >>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
> >>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
> >>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
> >>
> >> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
> >> line.  I assume TYPE refers to the covariance structure, and VC means
> >> variance components.  AFAIK, the MIXED command in SPSS does not allow
> >> COVTYPE=VC on the /REPEATED line.  From the FM:
> >>
> >> "If the variance components structure is specified on the REPEATED
> >> subcommand, it is replaced by the
> >> diagonal (DIAG) structure."
> >>
> >> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
> >> Or
> >> is it something else about my /REPEATED line?
> >>
> >> I apologize again for posting such a long & complicated question--but I
> >> don't like seeing authors who don't use SPSS writing comments like "SPSS
> >> will not allow heterogeneous errors" when in fact it will!  So I'd like
> >> to
> >> figure this out and let them know how to do it.  ;-)
> >>
> >> Cheers,
> >> Bruce
> >>
> >>
> >>
> >>
> >>
> >> -----
> >> --
> >> Bruce Weaver
> >>
>
> > bweaver@
>
> >> http://sites.google.com/a/lakeheadu.ca/bweaver/
> >>
> >> "When all else fails, RTFM."
> >>
> >> NOTE: My Hotmail account is not monitored regularly.
> >> To send me an e-mail, please use the address shown above.
> >>
> >> --
> >> View this message in context:
> >>
> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a message to
> >>
>
> > LISTSERV@.UGA
>
> >  (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
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
In reply to this post by Kornbrot, Diana
Diana, I don't understand your statement, "...using covtype(diag) instead of covtype(un) brings in the very unrealisitc assumption of homigeneity of variaiance etc."  The DIAG covariance type is used on the /REPEATED subcommand in that example, not /RANDOM:

   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).

And it is COVTYPE(DIAG) that allows heterogeneity of variance.  From the list of covariance structures in the FM:

DIAG Diagonal.This is a diagonal structure with heterogenous variance. This is the default covariance structure for repeated effects. (emphasis added)

Cheers,
Bruce


Kornbrot, Diana wrote
Yes
One does not need to specify the subject variable as random as SPSS does this automatically
BUT  using covtype(diag) instead of covtype(un) brings in the very unrealisitc assumption of homigeneity of variaiance etc. One of the (in my view major) advantage of mixed is that the unstructured covariance matrix takes care of variance heterogeneity automatically. This is true even for between group designs, and very useful as only oneway does this [not GLM]
Best

diana


On 26/11/2013 03:01, "Ryan Black" <[hidden email]> wrote:

Bruce,

The code BELOW my name produces 10 parameter estimates and standard errors that are virtually identical to those reported in the article for model 2b. Note that there is a separate variance component for each level of "oldage" from the second RANDOM statement as is specified in the SAS MIXED code.

Best,

Ryan

--

RECODE oldage (0=1) (1=0) INTO oldage2.
EXECUTE.

 MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65 oldage2
   /FIXED  = c_mean c_sal oldage yrs65
   /METHOD = ML
   /PRINT  = SOLUTION TESTCOV R G
   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(ID)
   /RANDOM = oldage oldage2 | SUBJECT(ID)
   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).



On Mon, Nov 25, 2013 at 10:28 AM, Bruce Weaver <[hidden email]> wrote:
Thanks Ryan.  I may be missing the obvious, but how would you specify the
model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
of changing the second /RANDOM line from

        /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
to
        /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)

If I do that, the model won't run, and I get this warning:

"The variables: oldage are specified both as subject variables in a RANDOM
subcommand and as repeated measure variables in the REPEATED subcommand.
Execution of this command stops."

I wonder if life would be any easier trying this via GENLINMIXED?



Ryan Black wrote
> Hi Bruce,
>
> One thing that immediately stands out to me is that the second RANDOM
> statement in the SPSS MIXED code does not estimate "oldage"-specific
> covariance parameters. OTOH, the SAS MIXED code specifies
> "oldage"-specific covariance parameters by including the keyword "GROUP="
> which increases the number of parameters being estimated by one, since
> there are presumably two age groups.
>
> Ryan
>
>> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <

> bruce.weaver@

> > wrote:
>> I apologize up front for the length & complexity of this post.  Anyone
>> who
>> decides to read it seriously is advised to have a cup (or maybe a pot) of
>> strong coffee at the ready!  ;-)
>>
>> I've been reading  this article
>> <http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub>
>> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
>> here
>> <http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
>> .
>>
>> Table 3 in the article shows 3 models for analysis of data with repeated
>> measures:
>>
>> 2A - Main effects only with homogeneous variances
>> 2B - Main effects only with heterogeneous variances
>> 3B - Main effects & selected interactions with heterogeneous variances
>>
>> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
>> (which
>> is in the .zip from the link given above).  Before anyone freaks out, let
>> me
>> point out that the data management steps in that syntax file could have
>> been
>> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
>>
>> Here is the MIXED command they used to run model 2A above (note that they
>> had command terminators on both /RANDOM sub-commands, and I had to remove
>> the first one to get the model to run):
>>
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> .
>>
>> The results from this command are very close to those reported in Table 3
>> of
>> the article.
>>
>> Now here's the bit that prompts my question:  A comment in the syntax
>> file
>> says that "SPSS will not allow heterogeneous errors", and therefore, no
>> attempt is made to fit model 2B.  However, it seemed to me that with an
>> appropriate /REPEATED sub-command, one should be able to fit model 2B.
>> After a little tinkering around, I came up with this syntax:
>>
>> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
>> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
>>   /FIXED  = c_mean c_sal oldage yrs65
>>   /METHOD = ML
>>   /PRINT  = SOLUTION TESTCOV R
>>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
>>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
>> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
>> .
>>
>> This is giving me results that are very similar to the Model 2B results
>> in
>> Table 3 of the article, but it's not quite right.  Notice that H&R's
>> Model
>> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.  So
>> I'm missing something, but I can't figure out what it is.
>>
>> Ryan, I hope you're reading this--maybe you can spot it.  In case it
>> helps,
>> here is the SAS code to run the same model--I assume the results reported
>> in
>> Table 3 are from SAS.
>>
>> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
>> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
>>    CLASS ID Item older;
>>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION DDFM=Satterthwaite;
>>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
>>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
>>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
>>
>> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
>> line.  I assume TYPE refers to the covariance structure, and VC means
>> variance components.  AFAIK, the MIXED command in SPSS does not allow
>> COVTYPE=VC on the /REPEATED line.  From the FM:
>>
>> "If the variance components structure is specified on the REPEATED
>> subcommand, it is replaced by the
>> diagonal (DIAG) structure."
>>
>> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
>> Or
>> is it something else about my /REPEATED line?
>>
>> I apologize again for posting such a long & complicated question--but I
>> don't like seeing authors who don't use SPSS writing comments like "SPSS
>> will not allow heterogeneous errors" when in fact it will!  So I'd like
>> to
>> figure this out and let them know how to do it.  ;-)
>>
>> Cheers,
>> Bruce
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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



________________________________
Professor Diana Kornbrot
email: : [hidden email]
web:    http://dianakornbrot.wordpress.com/
            http://go.herts.ac.uk/diana_kornbrot
Work
Department of Psychology
School of Life and Medical Sciences
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
Home
19 Elmhurst Avenue
London N2 0LT, UK
voice:   +44 (0) 208  444 2081
mobile: +44 (0) 740 318 1612
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Problem specifying MIXED model with heterogeneous variances

Bruce Weaver
Administrator
In reply to this post by Bruce Weaver
Diana raised the topic of COVTYPE = UN (for unstructured).  If I run Ryan's syntax but with COVTYPE(UN) rather than COVTYPE(VC), the Model Dimension table tells me there are 11 parameters rather than 10.  However, one of those 11 parameters is a redundant covariance term that is equal to 0; so in reality, there are 10 parameters, and all estimates are identical to those from the first model with COVTYPE(VC).



Bruce Weaver wrote
Yes, that does it.  And just for completeness, COVTYPE = VC (the default for /RANDOM) on this line:

   /RANDOM = oldage oldage2 | SUBJECT(ID) COVTYPE(VC)

Thanks Ryan.  


Ryan Black wrote
Bruce,

The code BELOW my name produces 10 parameter estimates and standard errors
that are virtually identical to those reported in the article for model
2b. Note that there is a separate variance component for each level
of "oldage" from the second RANDOM statement as is specified in the SAS
MIXED code.

Best,

Ryan

--

RECODE oldage (0=1) (1=0) INTO oldage2.
EXECUTE.

 MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65 oldage2
   /FIXED  = c_mean c_sal oldage yrs65
   /METHOD = ML
   /PRINT  = SOLUTION TESTCOV R G
   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(ID)
   /RANDOM = oldage oldage2 | SUBJECT(ID)
   /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG).



On Mon, Nov 25, 2013 at 10:28 AM, Bruce Weaver <[hidden email]>wrote:

> Thanks Ryan.  I may be missing the obvious, but how would you specify the
> model run by that SAS code in SPSS MIXED syntax?  It is not a simple matter
> of changing the second /RANDOM line from
>
>         /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> to
>         /RANDOM = INTERCEPT | SUBJECT(oldage) COVTYPE(UN)
>
> If I do that, the model won't run, and I get this warning:
>
> "The variables: oldage are specified both as subject variables in a RANDOM
> subcommand and as repeated measure variables in the REPEATED subcommand.
> Execution of this command stops."
>
> I wonder if life would be any easier trying this via GENLINMIXED?
>
>
>
> Ryan Black wrote
> > Hi Bruce,
> >
> > One thing that immediately stands out to me is that the second RANDOM
> > statement in the SPSS MIXED code does not estimate "oldage"-specific
> > covariance parameters. OTOH, the SAS MIXED code specifies
> > "oldage"-specific covariance parameters by including the keyword "GROUP="
> > which increases the number of parameters being estimated by one, since
> > there are presumably two age groups.
> >
> > Ryan
> >
> >> On Fri, Nov 22, 2013 at 5:29 PM, Bruce Weaver <
>
> > bruce.weaver@
>
> > > wrote:
> >> I apologize up front for the length & complexity of this post.  Anyone
> >> who
> >> decides to read it seriously is advised to have a cup (or maybe a pot)
> of
> >> strong coffee at the ready!  ;-)
> >>
> >> I've been reading  this article
> >> <
> http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1420&context=psychfacpub
> >
> >> by Hoffman & Rovine (2007), and looking at the SPSS syntax they provide
> >> here
> >> <
> http://psych.unl.edu/hoffman/Sheets/Research/MLM_for_Exp_Appendices.zip>
> >> .
> >>
> >> Table 3 in the article shows 3 models for analysis of data with repeated
> >> measures:
> >>
> >> 2A - Main effects only with homogeneous variances
> >> 2B - Main effects only with heterogeneous variances
> >> 3B - Main effects & selected interactions with heterogeneous variances
> >>
> >> The SPSS syntax for these models is found in file /MLM_AppendixA.sps/
> >> (which
> >> is in the .zip from the link given above).  Before anyone freaks out,
> let
> >> me
> >> point out that the data management steps in that syntax file could have
> >> been
> >> done a lot more efficiently.  ;-)  But that's not what I'm asking about.
> >>
> >> Here is the MIXED command they used to run model 2A above (note that
> they
> >> had command terminators on both /RANDOM sub-commands, and I had to
> remove
> >> the first one to get the model to run):
> >>
> >> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
> >>   /FIXED  = c_mean c_sal oldage yrs65
> >>   /METHOD = ML
> >>   /PRINT  = SOLUTION TESTCOV R
> >>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
> >>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> >> .
> >>
> >> The results from this command are very close to those reported in Table
> 3
> >> of
> >> the article.
> >>
> >> Now here's the bit that prompts my question:  A comment in the syntax
> >> file
> >> says that "SPSS will not allow heterogeneous errors", and therefore, no
> >> attempt is made to fit model 2B.  However, it seemed to me that with an
> >> appropriate /REPEATED sub-command, one should be able to fit model 2B.
> >> After a little tinkering around, I came up with this syntax:
> >>
> >> TITLE 'Table 3, Model 2B: Main Effects & Heterogeneous Errors'.
> >> MIXED lg_rt BY ID Item WITH c_mean c_sal oldage yrs65
> >>   /FIXED  = c_mean c_sal oldage yrs65
> >>   /METHOD = ML
> >>   /PRINT  = SOLUTION TESTCOV R
> >>   /RANDOM = INTERCEPT | SUBJECT(Item) COVTYPE(UN)
> >>   /RANDOM = INTERCEPT | SUBJECT(ID) COVTYPE(UN)
> >> *  /REPEATED = oldage | SUBJECT(ID*Item) COVTYPE(DIAG)*
> >> .
> >>
> >> This is giving me results that are very similar to the Model 2B results
> >> in
> >> Table 3 of the article, but it's not quite right.  Notice that H&R's
> >> Model
> >> 2B has 10 parameters.  Mine, on the other hand has only 9 parameters.
>  So
> >> I'm missing something, but I can't figure out what it is.
> >>
> >> Ryan, I hope you're reading this--maybe you can spot it.  In case it
> >> helps,
> >> here is the SAS code to run the same model--I assume the results
> reported
> >> in
> >> Table 3 are from SAS.
> >>
> >> TITLE 'SAS Model 1.2b: Main Effects Model with Heterogeneous Errors';
> >> PROC MIXED DATA=Example.Ex1 COVTEST NOCLPRINT  MAXITER=1000 METHOD=ML;
> >>    CLASS ID Item older;
> >>    MODEL lg_rt = c_mean c_sal oldage yrs65 / SOLUTION
> DDFM=Satterthwaite;
> >>    RANDOM INTERCEPT / SUBJECT=Item TYPE=UN;
> >>    RANDOM INTERCEPT / SUBJECT=ID TYPE=UN GROUP=older;
> >>    REPEATED /SUBJECT=ID TYPE=VC GROUP=older; run;
> >>
> >> One thing I do notice is that the SAS code shows TYPE=VC on the REPEATED
> >> line.  I assume TYPE refers to the covariance structure, and VC means
> >> variance components.  AFAIK, the MIXED command in SPSS does not allow
> >> COVTYPE=VC on the /REPEATED line.  From the FM:
> >>
> >> "If the variance components structure is specified on the REPEATED
> >> subcommand, it is replaced by the
> >> diagonal (DIAG) structure."
> >>
> >> So I wonder if VC vs DIAG is responsible for 10 vs 9 model parameters?
> >> Or
> >> is it something else about my /REPEATED line?
> >>
> >> I apologize again for posting such a long & complicated question--but I
> >> don't like seeing authors who don't use SPSS writing comments like "SPSS
> >> will not allow heterogeneous errors" when in fact it will!  So I'd like
> >> to
> >> figure this out and let them know how to do it.  ;-)
> >>
> >> Cheers,
> >> Bruce
> >>
> >>
> >>
> >>
> >>
> >> -----
> >> --
> >> Bruce Weaver
> >>
>
> > bweaver@
>
> >> http://sites.google.com/a/lakeheadu.ca/bweaver/
> >>
> >> "When all else fails, RTFM."
> >>
> >> NOTE: My Hotmail account is not monitored regularly.
> >> To send me an e-mail, please use the address shown above.
> >>
> >> --
> >> View this message in context:
> >>
> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261.html
> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a message to
> >>
>
> > LISTSERV@.UGA
>
> >  (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
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/Problem-specifying-MIXED-model-with-heterogeneous-variances-tp5723261p5723289.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).