Polynomial contrast for interaction in completely between-Ss design

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

Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to spit out polynomial contrasts for the A*B interaction (in a completely between-Ss design).  For a within-Ss or mixed design, this would be part of the default output from GLM-Repeated Measures.  I should like to think one can also get it for the completely between-Ss case.  But no luck so far.

* This will run, but does not give the output I want.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /DESIGN=A B A*B.

* This will NOT run --the 3rd /CONTRAST line louses it up.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /CONTRAST(A*B)=Polynomial
  /DESIGN=A B A*B.

Any thoughts?  Do I have to resort to MANOVA, perhaps?

Thanks.
--
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
Why aren't you using the MIXED procedure, Bruce? For shame... :-)

On Wed, Oct 26, 2011 at 5:58 PM, Bruce Weaver <[hidden email]> wrote:

> Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to spit
> out polynomial contrasts for the A*B interaction (in a completely between-Ss
> design).  For a within-Ss or mixed design, this would be part of the default
> output from GLM-Repeated Measures.  I should like to think one can also get
> it for the completely between-Ss case.  But no luck so far.
>
> * This will run, but does not give the output I want.
> UNIANOVA Y by A B
>  /CONTRAST(A)=Polynomial
>  /CONTRAST(B)=Polynomial
>  /DESIGN=A B A*B.
>
> * This will NOT run --the 3rd /CONTRAST line louses it up.
> UNIANOVA Y by A B
>  /CONTRAST(A)=Polynomial
>  /CONTRAST(B)=Polynomial
>  /CONTRAST(A*B)=Polynomial
>  /DESIGN=A B A*B.
>
> Any thoughts?  Do I have to resort to MANOVA, perhaps?
>
> Thanks.
>
>
> -----
> --
> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4941355.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

David Marso
Administrator
In reply to this post by Bruce Weaver
Bruce,
 " /CONTRAST(A*B)=Polynomial "???????????
Not sure why you think this would parse.
FM
"/CONTRAST (factor name)"
What are you attempting to achieve here?  The interaction would be the product of the main effect vectors in the design matrix.
HTH, David

Bruce Weaver wrote
Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to spit out polynomial contrasts for the A*B interaction (in a completely between-Ss design).  For a within-Ss or mixed design, this would be part of the default output from GLM-Repeated Measures.  I should like to think one can also get it for the completely between-Ss case.  But no luck so far.

* This will run, but does not give the output I want.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /DESIGN=A B A*B.

* This will NOT run --the 3rd /CONTRAST line louses it up.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /CONTRAST(A*B)=Polynomial
  /DESIGN=A B A*B.

Any thoughts?  Do I have to resort to MANOVA, perhaps?

Thanks.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
DM: "What are you attempting to achieve here?"

For the data set that prompted the question, I am attempting to show that virtually all of the A*B interaction is due to the linear component of the interaction.  A plot of means looks approximately like this (best viewed in fixed font):

|
|  x  x  x  x
|           o
|        o
|     o
|  o
--------------

As noted in my first post, if at least one of the factors had repeated measures, the polynomial contrast in GLM Repeated Measures would give me what I'm after.  

David Marso wrote
Bruce,
 " /CONTRAST(A*B)=Polynomial "???????????
Not sure why you think this would parse.
FM
"/CONTRAST (factor name)"
What are you attempting to achieve here?  The interaction would be the product of the main effect vectors in the design matrix.
HTH, David

Bruce Weaver wrote
Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to spit out polynomial contrasts for the A*B interaction (in a completely between-Ss design).  For a within-Ss or mixed design, this would be part of the default output from GLM-Repeated Measures.  I should like to think one can also get it for the completely between-Ss case.  But no luck so far.

* This will run, but does not give the output I want.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /DESIGN=A B A*B.

* This will NOT run --the 3rd /CONTRAST line louses it up.
UNIANOVA Y by A B
  /CONTRAST(A)=Polynomial
  /CONTRAST(B)=Polynomial
  /CONTRAST(A*B)=Polynomial
  /DESIGN=A B A*B.

Any thoughts?  Do I have to resort to MANOVA, perhaps?

Thanks.
--
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: Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
In reply to this post by Ryan
Hi Ryan.  AFAIK, MIXED doesn't have polynomial contrasts built in. So I think I'd have to use /TEST, and look up (or work out) the coefficients I'd need.  It may come down to that, but I was hoping there might be an easier way, similar to what one gets in GLM Repeated Measures.  ;-)


R B wrote
Why aren't you using the MIXED procedure, Bruce? For shame... :-)

On Wed, Oct 26, 2011 at 5:58 PM, Bruce Weaver <[hidden email]> wrote:
> Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to spit
> out polynomial contrasts for the A*B interaction (in a completely between-Ss
> design).  For a within-Ss or mixed design, this would be part of the default
> output from GLM-Repeated Measures.  I should like to think one can also get
> it for the completely between-Ss case.  But no luck so far.
>
> * This will run, but does not give the output I want.
> UNIANOVA Y by A B
>  /CONTRAST(A)=Polynomial
>  /CONTRAST(B)=Polynomial
>  /DESIGN=A B A*B.
>
> * This will NOT run --the 3rd /CONTRAST line louses it up.
> UNIANOVA Y by A B
>  /CONTRAST(A)=Polynomial
>  /CONTRAST(B)=Polynomial
>  /CONTRAST(A*B)=Polynomial
>  /DESIGN=A B A*B.
>
> Any thoughts?  Do I have to resort to MANOVA, perhaps?
>
> Thanks.
>
>
> -----
> --
> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4941355.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Anthony Babinec
I think that you have to use MANOVA. GLM uses "set to 0" contrasts while
MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
that you can imitate. I just took some "nonsense" variables from the
General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
The design shows the linear by linear interaction as an example.

manova educ by hhsize(1,3) race(1,3) /
 contrast(hhsize)=poly/
 contrast(race)=poly/
 partition(hhsize)=(1,1)/
 partition(race)=(1,1)/
 print=design/
 DESIGN=hhsize race hhsize(1) by race(1).

Tony Babinec
[hidden email]

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
In reply to this post by Bruce Weaver
Bruce,

If you want to conduct a formal test on the interaction between the
linear trends of A (assuming two levels) across B (assuming 4 levels),
then the MIXED code would be:

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3.

Is this what you're after?

Ryan

On Wed, Oct 26, 2011 at 8:41 PM, Bruce Weaver <[hidden email]> wrote:

> Hi Ryan.  AFAIK, MIXED doesn't have polynomial contrasts built in. So I think
> I'd have to use /TEST, and look up (or work out) the coefficients I'd need.
> It may come down to that, but I was *hoping* there might be an easier way,
> similar to what one gets in GLM Repeated Measures.  ;-)
>
>
>
> R B wrote:
>>
>> Why aren't you using the MIXED procedure, Bruce? For shame... :-)
>>
>> On Wed, Oct 26, 2011 at 5:58 PM, Bruce Weaver <bruce.weaver@> wrote:
>>> Maybe it's just  too late in the day, but I'm unable to get UNIANOVA to
>>> spit
>>> out polynomial contrasts for the A*B interaction (in a completely
>>> between-Ss
>>> design).  For a within-Ss or mixed design, this would be part of the
>>> default
>>> output from GLM-Repeated Measures.  I should like to think one can also
>>> get
>>> it for the completely between-Ss case.  But no luck so far.
>>>
>>> * This will run, but does not give the output I want.
>>> UNIANOVA Y by A B
>>>  /CONTRAST(A)=Polynomial
>>>  /CONTRAST(B)=Polynomial
>>>  /DESIGN=A B A*B.
>>>
>>> * This will NOT run --the 3rd /CONTRAST line louses it up.
>>> UNIANOVA Y by A B
>>>  /CONTRAST(A)=Polynomial
>>>  /CONTRAST(B)=Polynomial
>>>  /CONTRAST(A*B)=Polynomial
>>>  /DESIGN=A B A*B.
>>>
>>> Any thoughts?  Do I have to resort to MANOVA, perhaps?
>>>
>>> Thanks.
>>>
>>>
>>> -----
>>> --
>>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4941355.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
>>>
>>
>> =====================
>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4941727.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
In reply to this post by Anthony Babinec
Aha...that looks like what I was after, Tony.  I'll give it a try.  Ryan, I'll give your /TEST for MIXED method a try too, and compare the results.

Thanks guys.


Anthony Babinec wrote
I think that you have to use MANOVA. GLM uses "set to 0" contrasts while
MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
that you can imitate. I just took some "nonsense" variables from the
General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
The design shows the linear by linear interaction as an example.

manova educ by hhsize(1,3) race(1,3) /
 contrast(hhsize)=poly/
 contrast(race)=poly/
 partition(hhsize)=(1,1)/
 partition(race)=(1,1)/
 print=design/
 DESIGN=hhsize race hhsize(1) by race(1).

Tony Babinec
[hidden email]

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
You do have exactly two levels for A and four levels for B, right?

Ryan

On Thu, Oct 27, 2011 at 7:23 AM, Bruce Weaver <[hidden email]> wrote:

> Aha...that looks like what I was after, Tony.  I'll give it a try.  Ryan,
> I'll give your /TEST for MIXED method a try too, and compare the results.
>
> Thanks guys.
>
>
>
> Anthony Babinec wrote:
>>
>> I think that you have to use MANOVA. GLM uses "set to 0" contrasts while
>> MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
>> that you can imitate. I just took some "nonsense" variables from the
>> General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
>> The design shows the linear by linear interaction as an example.
>>
>> manova educ by hhsize(1,3) race(1,3) /
>>  contrast(hhsize)=poly/
>>  contrast(race)=poly/
>>  partition(hhsize)=(1,1)/
>>  partition(race)=(1,1)/
>>  print=design/
>>  DESIGN=hhsize race hhsize(1) by race(1).
>>
>> Tony Babinec
>> tbabinec@
>>
>> =====================
>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4942677.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
Yes, that's right.

I forgot to mention when responding to your earlier post that another reason for not using MIXED (with TEST) was that I preferred OLS to MLE, because in a balanced design, the SS for the polynomial components of the A*B interaction will add up exactly to the SS(A*B).  I doubt that will be the case with MLE.

I've still not had time to try either method--too many meetings.  Will get to it later today or tomorrow.

Cheers,
Bruce


R B wrote
You do have exactly two levels for A and four levels for B, right?

Ryan

On Thu, Oct 27, 2011 at 7:23 AM, Bruce Weaver <[hidden email]> wrote:
> Aha...that looks like what I was after, Tony.  I'll give it a try.  Ryan,
> I'll give your /TEST for MIXED method a try too, and compare the results.
>
> Thanks guys.
>
>
>
> Anthony Babinec wrote:
>>
>> I think that you have to use MANOVA. GLM uses "set to 0" contrasts while
>> MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
>> that you can imitate. I just took some "nonsense" variables from the
>> General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
>> The design shows the linear by linear interaction as an example.
>>
>> manova educ by hhsize(1,3) race(1,3) /
>>  contrast(hhsize)=poly/
>>  contrast(race)=poly/
>>  partition(hhsize)=(1,1)/
>>  partition(race)=(1,1)/
>>  print=design/
>>  DESIGN=hhsize race hhsize(1) by race(1).
>>
>> Tony Babinec
>> tbabinec@
>>
>> =====================
>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4942677.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

David Marso
Administrator
INPUT PROGRAM.
LOOP ID=1 TO 1000.
COMPUTE X1=TRUNC(UNIFORM(4))+1.
COMPUTE X2=TRUNC(UNIFORM(2))+1.
end case.
end loop.
end file.
end input program.
 
DO IF X2=1.
COMPUTE Y=NORMAL(1)+10.
ELSE.
COMPUTE Y=NORMAL(1)+ X1*2.
END IF.
RECODE X1 (1=-0.670820393249937)(2= -0.223606797749979  )(3= 0.223606797749979  )(4=0.670820393249937) INTO LX1.
RECODE X2 (1=-0.707106781186547)(2= 0.707106781186547) INTO LX2.
COMPUTE LX1LX2=LX1*LX2.

MEANS TABLES=y  By x2 BY x1 .
REGRESSION / DEP Y / METHOD ENTER LX1 LX2 LX1LX2.
MANOVA Y WITH LX1 LX2 LX1LX2.

manova y by x1(1,4) x2(1,2) /
 contrast(x1)=poly/
 contrast(x2)=poly/
 partition(x1)=(1,1)/
 print=design/
 DESIGN=x1 x2 x1(1) by x2.

MIXED Y BY X1 X2
 /FIXED=X1 X2 X1*X2 | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear X1'  X1 -0.670820393249937 -0.223606797749979  0.223606797749979  0.670820393249937
 /TEST = 'Linear X2'  X2 -0.707106781186547 0.707106781186547
 /TEST = 'Linear Trend Interaction' X1*X2 0.474341649025257 -0.474341649025257 0.158113883008419 -0.158113883008419 -0.158113883008419 0.158113883008419 -0.474341649025257 0.474341649025257 .


Bruce Weaver wrote
Yes, that's right.

I forgot to mention when responding to your earlier post that another reason for not using MIXED (with TEST) was that I preferred OLS to MLE, because in a balanced design, the SS for the polynomial components of the A*B interaction will add up exactly to the SS(A*B).  I doubt that will be the case with MLE.

I've still not had time to try either method--too many meetings.  Will get to it later today or tomorrow.

Cheers,
Bruce


R B wrote
You do have exactly two levels for A and four levels for B, right?

Ryan

On Thu, Oct 27, 2011 at 7:23 AM, Bruce Weaver <[hidden email]> wrote:
> Aha...that looks like what I was after, Tony.  I'll give it a try.  Ryan,
> I'll give your /TEST for MIXED method a try too, and compare the results.
>
> Thanks guys.
>
>
>
> Anthony Babinec wrote:
>>
>> I think that you have to use MANOVA. GLM uses "set to 0" contrasts while
>> MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
>> that you can imitate. I just took some "nonsense" variables from the
>> General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
>> The design shows the linear by linear interaction as an example.
>>
>> manova educ by hhsize(1,3) race(1,3) /
>>  contrast(hhsize)=poly/
>>  contrast(race)=poly/
>>  partition(hhsize)=(1,1)/
>>  partition(race)=(1,1)/
>>  print=design/
>>  DESIGN=hhsize race hhsize(1) by race(1).
>>
>> Tony Babinec
>> tbabinec@
>>
>> =====================
>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4942677.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
>

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Polynomial contrast for interaction in completely between-Ss design

Ryan
David,

Not sure that you're constructing your linear x1 and linear x2 trend
TEST statements correctly in MIXED. No time to review carefully right
now. More later when I have time to dissect.

Ryan

On Fri, Oct 28, 2011 at 10:09 AM, David Marso <[hidden email]> wrote:

> INPUT PROGRAM.
> LOOP ID=1 TO 1000.
> COMPUTE X1=TRUNC(UNIFORM(4))+1.
> COMPUTE X2=TRUNC(UNIFORM(2))+1.
> end case.
> end loop.
> end file.
> end input program.
>
> DO IF X2=1.
> COMPUTE Y=NORMAL(1)+10.
> ELSE.
> COMPUTE Y=NORMAL(1)+ X1*2.
> END IF.
> RECODE X1 (1=-0.670820393249937)(2= -0.223606797749979  )(3=
> 0.223606797749979  )(4=0.670820393249937) INTO LX1.
> RECODE X2 (1=-0.707106781186547)(2= 0.707106781186547) INTO LX2.
> COMPUTE LX1LX2=LX1*LX2.
>
> MEANS TABLES=y  By x2 BY x1 .
> REGRESSION / DEP Y / METHOD ENTER LX1 LX2 LX1LX2.
> MANOVA Y WITH LX1 LX2 LX1LX2.
>
> manova y by x1(1,4) x2(1,2) /
>  contrast(x1)=poly/
>  contrast(x2)=poly/
>  partition(x1)=(1,1)/
>  print=design/
>  DESIGN=x1 x2 x1(1) by x2.
>
> MIXED Y BY X1 X2
>  /FIXED=X1 X2 X1*X2 | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear X1'  X1 -0.670820393249937      -0.223606797749979
> 0.223606797749979  0.670820393249937
>  /TEST = 'Linear X2'  X2 -0.707106781186547     0.707106781186547
>  /TEST = 'Linear Trend Interaction' X1*X2 0.474341649025257
> -0.474341649025257      0.158113883008419       -0.158113883008419      -0.158113883008419
> 0.158113883008419       -0.474341649025257      0.474341649025257       .
>
>
>
> Bruce Weaver wrote:
>>
>> Yes, that's right.
>>
>> I forgot to mention when responding to your earlier post that another
>> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>> because in a balanced design, the SS for the polynomial components of the
>> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>> the case with MLE.
>>
>> I've still not had time to try either method--too many meetings.  Will get
>> to it later today or tomorrow.
>>
>> Cheers,
>> Bruce
>>
>>
>>
>> R B wrote:
>>>
>>> You do have exactly two levels for A and four levels for B, right?
>>>
>>> Ryan
>>>
>>> On Thu, Oct 27, 2011 at 7:23 AM, Bruce Weaver &lt;bruce.weaver@&gt;
>>> wrote:
>>>> Aha...that looks like what I was after, Tony.  I'll give it a try.
>>>> Ryan,
>>>> I'll give your /TEST for MIXED method a try too, and compare the
>>>> results.
>>>>
>>>> Thanks guys.
>>>>
>>>>
>>>>
>>>> Anthony Babinec wrote:
>>>>>
>>>>> I think that you have to use MANOVA. GLM uses "set to 0" contrasts
>>>>> while
>>>>> MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
>>>>> that you can imitate. I just took some "nonsense" variables from the
>>>>> General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
>>>>> The design shows the linear by linear interaction as an example.
>>>>>
>>>>> manova educ by hhsize(1,3) race(1,3) /
>>>>>  contrast(hhsize)=poly/
>>>>>  contrast(race)=poly/
>>>>>  partition(hhsize)=(1,1)/
>>>>>  partition(race)=(1,1)/
>>>>>  print=design/
>>>>>  DESIGN=hhsize race hhsize(1) by race(1).
>>>>>
>>>>> Tony Babinec
>>>>> tbabinec@
>>>>>
>>>>> =====================
>>>>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4942677.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
>>>>
>>>
>>> =====================
>>> 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
>>>
>>
>
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4946042.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

David Marso
Administrator
Hi Ryan,
  I'm pretty sure they are incorrect ;-(
Getting:
Warnings
Custom hypothesis test 1 (Linear X1) will not be performed because the L matrix is not estimable.
Custom hypothesis test 2 (Linear X2) will not be performed because the L matrix is not estimable.

I received the same warning from running your previous test statement.
MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3.

I am rather new to MIXED, but old school MANOVA user from as far back as 1994 .
Would be cool to know what MIXED expects for the two main effect linear TESTs
David

R B wrote
David,

Not sure that you're constructing your linear x1 and linear x2 trend
TEST statements correctly in MIXED. No time to review carefully right
now. More later when I have time to dissect.

Ryan

On Fri, Oct 28, 2011 at 10:09 AM, David Marso <[hidden email]> wrote:
> INPUT PROGRAM.
> LOOP ID=1 TO 1000.
> COMPUTE X1=TRUNC(UNIFORM(4))+1.
> COMPUTE X2=TRUNC(UNIFORM(2))+1.
> end case.
> end loop.
> end file.
> end input program.
>
> DO IF X2=1.
> COMPUTE Y=NORMAL(1)+10.
> ELSE.
> COMPUTE Y=NORMAL(1)+ X1*2.
> END IF.
> RECODE X1 (1=-0.670820393249937)(2= -0.223606797749979  )(3=
> 0.223606797749979  )(4=0.670820393249937) INTO LX1.
> RECODE X2 (1=-0.707106781186547)(2= 0.707106781186547) INTO LX2.
> COMPUTE LX1LX2=LX1*LX2.
>
> MEANS TABLES=y  By x2 BY x1 .
> REGRESSION / DEP Y / METHOD ENTER LX1 LX2 LX1LX2.
> MANOVA Y WITH LX1 LX2 LX1LX2.
>
> manova y by x1(1,4) x2(1,2) /
>  contrast(x1)=poly/
>  contrast(x2)=poly/
>  partition(x1)=(1,1)/
>  print=design/
>  DESIGN=x1 x2 x1(1) by x2.
>
> MIXED Y BY X1 X2
>  /FIXED=X1 X2 X1*X2 | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear X1'  X1 -0.670820393249937      -0.223606797749979
> 0.223606797749979  0.670820393249937
>  /TEST = 'Linear X2'  X2 -0.707106781186547     0.707106781186547
>  /TEST = 'Linear Trend Interaction' X1*X2 0.474341649025257
> -0.474341649025257      0.158113883008419       -0.158113883008419      -0.158113883008419
> 0.158113883008419       -0.474341649025257      0.474341649025257       .
>
>
>
> Bruce Weaver wrote:
>>
>> Yes, that's right.
>>
>> I forgot to mention when responding to your earlier post that another
>> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>> because in a balanced design, the SS for the polynomial components of the
>> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>> the case with MLE.
>>
>> I've still not had time to try either method--too many meetings.  Will get
>> to it later today or tomorrow.
>>
>> Cheers,
>> Bruce
>>
>>
>>
>> R B wrote:
>>>
>>> You do have exactly two levels for A and four levels for B, right?
>>>
>>> Ryan
>>>
>>> On Thu, Oct 27, 2011 at 7:23 AM, Bruce Weaver <bruce.weaver@>
>>> wrote:
>>>> Aha...that looks like what I was after, Tony.  I'll give it a try.
>>>> Ryan,
>>>> I'll give your /TEST for MIXED method a try too, and compare the
>>>> results.
>>>>
>>>> Thanks guys.
>>>>
>>>>
>>>>
>>>> Anthony Babinec wrote:
>>>>>
>>>>> I think that you have to use MANOVA. GLM uses "set to 0" contrasts
>>>>> while
>>>>> MANOVA uses "sum to 0" contrasts. Here is a short MANOVA example
>>>>> that you can imitate. I just took some "nonsense" variables from the
>>>>> General Social Survey and recode hhsize as 1=1, 2=2, 3 thru 11=3.
>>>>> The design shows the linear by linear interaction as an example.
>>>>>
>>>>> manova educ by hhsize(1,3) race(1,3) /
>>>>>  contrast(hhsize)=poly/
>>>>>  contrast(race)=poly/
>>>>>  partition(hhsize)=(1,1)/
>>>>>  partition(race)=(1,1)/
>>>>>  print=design/
>>>>>  DESIGN=hhsize race hhsize(1) by race(1).
>>>>>
>>>>> Tony Babinec
>>>>> tbabinec@
>>>>>
>>>>> =====================
>>>>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4942677.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
>>>>
>>>
>>> =====================
>>> 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
>>>
>>
>
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4946042.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
>

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Polynomial contrast for interaction in completely between-Ss design

Bruce Weaver
Administrator
In reply to this post by Bruce Weaver
Bruce Weaver wrote
Yes, that's right.

I forgot to mention when responding to your earlier post that another reason for not using MIXED (with TEST) was that I preferred OLS to MLE, because in a balanced design, the SS for the polynomial components of the A*B interaction will add up exactly to the SS(A*B).  I doubt that will be the case with MLE.

I've still not had time to try either method--too many meetings.  Will get to it later today or tomorrow.

Cheers,
Bruce
Okay, I finally had (or took) time to get back to this.  WARNING:  There is a fair bit of syntax here.  But anyone who is interested in the discussion we've been having here might be interested in working through the various examples.  I certainly have a better appreciation for how PARTITION works in MANOVA now!  ;-)

Thanks again to Tony, Ryan & David.  


* Read in the data .
data list list / Y A B (3f5.0).
begin data
     6     0     1
     7     0     1
     3     0     1
     4     0     1
     9     0     1
     5     0     2
    11     0     2
     6     0     2
     5     0     2
     7     0     2
    13     0     3
    12     0     3
    10     0     3
    14     0     3
     9     0     3
    15     0     4
    19     0     4
    13     0     4
    17     0     4
    12     0     4
    15     1     1
    18     1     1
    14     1     1
    13     1     1
    15     1     1
    14     1     2
    17     1     2
    15     1     2
    11     1     2
    14     1     2
    16     1     3
    18     1     3
    19     1     3
    11     1     3
    14     1     3
    17     1     4
    15     1     4
    19     1     4
    14     1     4
    16     1     4
end data.

* Run model via UNIANOVA .
UNIANOVA Y BY A B
  /CRITERIA=ALPHA(.05)
  /DESIGN=A B A*B.

* Run model via MANOVA.
manova Y by A(0,1) B(1,4) /
 print=design/
 DESIGN=A B A by B.

* Sums of Squares from UNIANOVA and MANOVA match.
* Now MANOVA with PARTITION to partition the A*B
* interaction into the linear, quadratic and cubic components.

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,1,1)/
 print=design/
 DESIGN=A B
  A by B(1)
  A by B(2)
  A by B(3)
.

* In the model that was just run,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = quadratic component of the interaction, and
*   A BY B(3) = cubic component of the interaction.

* The SS for the linear, quadratic & cubic components sum to 99.40,
* the same value as SS(A*B) in the earlier runs.  Good! .

* Now try partitioning into linear vs (quadratic + cubic).

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,2)/
 print=design/
 DESIGN=A B
  A by B(1)
  A by B(2)
.

* In this model,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = linear + cubic components of the interaction.

* The SS for A * B(2) in this model is the sum of the SS
* for the quadratic & cubic components of the interaction in the
* previous run that partitioned the SS into 3 components, each with
* df = 1.  So all is well with the world.


* Try Ryan's MIXED with /TEST method.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
          3  1 -1 -3
         -3 -1  1  3
.
* The t-value is comparable to what MANOVA gives for the linear component
* of the interaction.  But the value of the estimate is much larger.
* This is because MANOVA concocted a different set of contrast coefficients.
* Plug them into MIXED, and see if the estimated values become more similar.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
         .47437  .15811 -.15811 -.47437
        -.47437 -.15811  .15811  .47437
.

* Okay, good.  Now the contrasts from MANOVA and MIXED
* are very similar.  

* But one thing the MIXED output doesn't give me is the SS for
* the various components.  These are nice to have, because
* I can use them to work out the percentage of the interaction
* effect that is due to the linear by linear component.
* In this case, it would be 98.0 / 99.4 = 98.6%.

* If MIXED can display SS in the "Tests of Fixed Effects"
* summary table, I can't find how to do it.

--
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
Bruce (and others who might be interested),
My initial understanding was that you were interested in testing for a
linear trend interaction derived from a GLM model which included two
factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):
(Place the following in Notepad to see it correctly formatted)

                  B       1      2      3      4
---------------------------  1 | a1b1 | a1b2 | a1b3 | a1b4 |A
---------------------------  2 | a2b1 | a2b2 | a2b3 | a2b4 |
---------------------------
I responded by defining what I thought you were referring to with
respect to a linear trend interaction; that is, a formal test on the
interaction between the linear trends of a1 and a2 across B.
Concretely, we’re testing if the means of a1 and a2 consistently trend
in a linear fashion more closely or farther as they move along the
levels of B (b1 through b4), i.e.,
(Place the following in Notepad to see it correctly formatted)
     |       |  ^                * A   |       ^     *        |
*     ^     |  *                ^        ------------------------
  1     2     3     4                 B  where
^ = a1 means for each level of B* = a2 means for each level of B
In this type of scenario, one typically assumes that the categorical
variable B has ordinal properties. Anyway, it was at this point that I
decided to suggest that you construct an interaction linear trend test
via MIXED using orthogonal polynomials. If one were to construct a
linear trend interaction test for the model specified above via MIXED,
one would need to first determine appropriate coefficients of
orthogonal polynomials. Further to this point, to appropriately
construct linear trends for both a1 and a2, their coefficients should
be equally spaced and sum to zero, which for an even # of levels of B
for a1 and a2, would be computed by using:
-(k-1) to (k-1) in increments of 2
where k = # of levels of B

which results in
-3 -1 1 3
(I've seen this described in multiple locations online and in
textbooks which describe orthogonal polynomial contrasts for ANOVA
type designs)

To obtain the  value of the linear combination using the TEST
statement, we would write the following code:
/TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0
We could write out the linear combination ourselves by plugging in the
estimated parameters:

-3*(-1.1999999999999993)-1*(-1.9999999999999982)+1*(-.6)+3*(0)-3*(-8.2)-1*(-6.4)+1*(-3)-3*(0)
+0*(0)+0*(0)+0*(0)+0*(0)= 33
By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we
are forcing the TEST statement to provide a formal test as to whether
there is a linear trend of a1 means across the four levels of B. But
“33” is the resulting value of summing the terms. What is the
estimated slope? If we wanted to obtain the slope of the linear trend,
then we would need to incorporate a divisor:
/TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0
0 0 DIVISOR=10
(If someone is interested in understanding how I arrived at the
DIVISOR of 10, feel free to ask. But I prefer to skip over this point
for the moment.)

The TEST statement above produces a slope estimate of the linear trend
for a=1 of 3.3. Although I haven’t tested this, for Bruce's example,
this slope value should be EXACTLY what you would obtain if you were
fit a standard linear regression treating the means of a1b1, a1b2,
a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
covariate.
For a similar linear trend test of a=2 across B, we would write:
/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1
1 3 /TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3
-1 1 3 DIVISOR=10
Based on this approach, if one wanted to test whether there was a
significant interaction between the linear trends of a1 and a2 across
B, then we would to take the difference of the linear trend
coefficients:

-3 -1 1 3 - (-3 -1 1 3)
or when removing the parentheses and placing it in the design figure I
presented initially:
(Place this in Notepad to obtain correct formatting)
-3 -1  1  3  3  1 -1 -3
This, of course, leads to the TEST statement:
/TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
Note: It would take very little effort to test for a quadratic or
cubic trends via the TEST statements.

Anyway, I hope this shows how I arrived at my interaction linear trend
TEST statement. It may not be the optimal approach, but  it seems
valid given Bruce's initial request to construct an interaction linear
trend test based on his GLM design. Perhaps I've misunderstood exactly
what he's trying to test or perhaps there is simply a better approach
using another procedure.

HTH,

Ryan
On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:

> Bruce Weaver wrote:
>>
>> Yes, that's right.
>>
>> I forgot to mention when responding to your earlier post that another
>> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>> because in a balanced design, the SS for the polynomial components of the
>> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>> the case with MLE.
>>
>> I've still not had time to try either method--too many meetings.  Will get
>> to it later today or tomorrow.
>>
>> Cheers,
>> Bruce
>>
>>
>
> Okay, I finally had (or took) time to get back to this.  WARNING:  There is
> a fair bit of syntax here.  But anyone who is interested in the discussion
> we've been having here might be interested in working through the various
> examples.  I certainly have a better appreciation for how PARTITION works in
> MANOVA now!  ;-)
>
> Thanks again to Tony, Ryan & David.
>
>
> * Read in the data .
> data list list / Y A B (3f5.0).
> begin data
>     6     0     1
>     7     0     1
>     3     0     1
>     4     0     1
>     9     0     1
>     5     0     2
>    11     0     2
>     6     0     2
>     5     0     2
>     7     0     2
>    13     0     3
>    12     0     3
>    10     0     3
>    14     0     3
>     9     0     3
>    15     0     4
>    19     0     4
>    13     0     4
>    17     0     4
>    12     0     4
>    15     1     1
>    18     1     1
>    14     1     1
>    13     1     1
>    15     1     1
>    14     1     2
>    17     1     2
>    15     1     2
>    11     1     2
>    14     1     2
>    16     1     3
>    18     1     3
>    19     1     3
>    11     1     3
>    14     1     3
>    17     1     4
>    15     1     4
>    19     1     4
>    14     1     4
>    16     1     4
> end data.
>
> * Run model via UNIANOVA .
> UNIANOVA Y BY A B
>  /CRITERIA=ALPHA(.05)
>  /DESIGN=A B A*B.
>
> * Run model via MANOVA.
> manova Y by A(0,1) B(1,4) /
>  print=design/
>  DESIGN=A B A by B.
>
> * Sums of Squares from UNIANOVA and MANOVA match.
> * Now MANOVA with PARTITION to partition the A*B
> * interaction into the linear, quadratic and cubic components.
>
> manova Y by A(0,1) B(1,4) /
>  contrast(A)=poly/
>  contrast(B)=poly/
>  partition(B)=(1,1,1)/
>  print=design/
>  DESIGN=A B
>  A by B(1)
>  A by B(2)
>  A by B(3)
> .
>
> * In the model that was just run,
> *   A BY B(1) = linear component of the interaction,
> *   A BY B(2) = quadratic component of the interaction, and
> *   A BY B(3) = cubic component of the interaction.
>
> * The SS for the linear, quadratic & cubic components sum to 99.40,
> * the same value as SS(A*B) in the earlier runs.  Good! .
>
> * Now try partitioning into linear vs (quadratic + cubic).
>
> manova Y by A(0,1) B(1,4) /
>  contrast(A)=poly/
>  contrast(B)=poly/
>  partition(B)=(1,2)/
>  print=design/
>  DESIGN=A B
>  A by B(1)
>  A by B(2)
> .
>
> * In this model,
> *   A BY B(1) = linear component of the interaction,
> *   A BY B(2) = linear + cubic components of the interaction.
>
> * The SS for A * B(2) in this model is the sum of the SS
> * for the quadratic & cubic components of the interaction in the
> * previous run that partitioned the SS into 3 components, each with
> * df = 1.  So all is well with the world.
>
>
> * Try Ryan's MIXED with /TEST method.
>
> MIXED Y BY A B
>  /FIXED=A B A*B | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear Trend Interaction' A*B
>          3  1 -1 -3
>         -3 -1  1  3
> .
> * The t-value is comparable to what MANOVA gives for the linear component
> * of the interaction.  But the value of the estimate is much larger.
> * This is because MANOVA concocted a different set of contrast coefficients.
> * Plug them into MIXED, and see if the estimated values become more similar.
>
> MIXED Y BY A B
>  /FIXED=A B A*B | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear Trend Interaction' A*B
>         .47437  .15811 -.15811 -.47437
>        -.47437 -.15811  .15811  .47437
> .
>
> * Okay, good.  Now the contrasts from MANOVA and MIXED
> * are very similar.
>
> * But one thing the MIXED output doesn't give me is the SS for
> * the various components.  These are nice to have, because
> * I can use them to work out the percentage of the interaction
> * effect that is due to the linear by linear component.
> * In this case, it would be 98.0 / 99.4 = 98.6%.
>
> * If MIXED can display SS in the "Tests of Fixed Effects"
> * summary table, I can't find how to do it.
>
>
>
> -----
> --
> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
Oh geez, my response was all garbled due to formatting issues. Ok.
Going to take a few minutes to fix up.

On Sat, Oct 29, 2011 at 11:37 AM, R B <[hidden email]> wrote:

> Bruce (and others who might be interested),
> My initial understanding was that you were interested in testing for a
> linear trend interaction derived from a GLM model which included two
> factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):
> (Place the following in Notepad to see it correctly formatted)
>
>                   B       1      2      3      4
> ---------------------------  1 | a1b1 | a1b2 | a1b3 | a1b4 |A
> ---------------------------  2 | a2b1 | a2b2 | a2b3 | a2b4 |
> ---------------------------
> I responded by defining what I thought you were referring to with
> respect to a linear trend interaction; that is, a formal test on the
> interaction between the linear trends of a1 and a2 across B.
> Concretely, we’re testing if the means of a1 and a2 consistently trend
> in a linear fashion more closely or farther as they move along the
> levels of B (b1 through b4), i.e.,
> (Place the following in Notepad to see it correctly formatted)
>      |       |  ^                * A   |       ^     *        |
> *     ^     |  *                ^        ------------------------
>   1     2     3     4                 B  where
> ^ = a1 means for each level of B* = a2 means for each level of B
> In this type of scenario, one typically assumes that the categorical
> variable B has ordinal properties. Anyway, it was at this point that I
> decided to suggest that you construct an interaction linear trend test
> via MIXED using orthogonal polynomials. If one were to construct a
> linear trend interaction test for the model specified above via MIXED,
> one would need to first determine appropriate coefficients of
> orthogonal polynomials. Further to this point, to appropriately
> construct linear trends for both a1 and a2, their coefficients should
> be equally spaced and sum to zero, which for an even # of levels of B
> for a1 and a2, would be computed by using:
> -(k-1) to (k-1) in increments of 2
> where k = # of levels of B
>
> which results in
> -3 -1 1 3
> (I've seen this described in multiple locations online and in
> textbooks which describe orthogonal polynomial contrasts for ANOVA
> type designs)
>
> To obtain the  value of the linear combination using the TEST
> statement, we would write the following code:
> /TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0
> We could write out the linear combination ourselves by plugging in the
> estimated parameters:
>
> -3*(-1.1999999999999993)-1*(-1.9999999999999982)+1*(-.6)+3*(0)-3*(-8.2)-1*(-6.4)+1*(-3)-3*(0)
> +0*(0)+0*(0)+0*(0)+0*(0)= 33
> By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we
> are forcing the TEST statement to provide a formal test as to whether
> there is a linear trend of a1 means across the four levels of B. But
> “33” is the resulting value of summing the terms. What is the
> estimated slope? If we wanted to obtain the slope of the linear trend,
> then we would need to incorporate a divisor:
> /TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0
> 0 0 DIVISOR=10
> (If someone is interested in understanding how I arrived at the
> DIVISOR of 10, feel free to ask. But I prefer to skip over this point
> for the moment.)
>
> The TEST statement above produces a slope estimate of the linear trend
> for a=1 of 3.3. Although I haven’t tested this, for Bruce's example,
> this slope value should be EXACTLY what you would obtain if you were
> fit a standard linear regression treating the means of a1b1, a1b2,
> a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
> covariate.
> For a similar linear trend test of a=2 across B, we would write:
> /TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1
> 1 3 /TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3
> -1 1 3 DIVISOR=10
> Based on this approach, if one wanted to test whether there was a
> significant interaction between the linear trends of a1 and a2 across
> B, then we would to take the difference of the linear trend
> coefficients:
>
> -3 -1 1 3 - (-3 -1 1 3)
> or when removing the parentheses and placing it in the design figure I
> presented initially:
> (Place this in Notepad to obtain correct formatting)
> -3 -1  1  3  3  1 -1 -3
> This, of course, leads to the TEST statement:
> /TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
> Note: It would take very little effort to test for a quadratic or
> cubic trends via the TEST statements.
>
> Anyway, I hope this shows how I arrived at my interaction linear trend
> TEST statement. It may not be the optimal approach, but  it seems
> valid given Bruce's initial request to construct an interaction linear
> trend test based on his GLM design. Perhaps I've misunderstood exactly
> what he's trying to test or perhaps there is simply a better approach
> using another procedure.
>
> HTH,
>
> Ryan
> On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:
>> Bruce Weaver wrote:
>>>
>>> Yes, that's right.
>>>
>>> I forgot to mention when responding to your earlier post that another
>>> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>>> because in a balanced design, the SS for the polynomial components of the
>>> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>>> the case with MLE.
>>>
>>> I've still not had time to try either method--too many meetings.  Will get
>>> to it later today or tomorrow.
>>>
>>> Cheers,
>>> Bruce
>>>
>>>
>>
>> Okay, I finally had (or took) time to get back to this.  WARNING:  There is
>> a fair bit of syntax here.  But anyone who is interested in the discussion
>> we've been having here might be interested in working through the various
>> examples.  I certainly have a better appreciation for how PARTITION works in
>> MANOVA now!  ;-)
>>
>> Thanks again to Tony, Ryan & David.
>>
>>
>> * Read in the data .
>> data list list / Y A B (3f5.0).
>> begin data
>>     6     0     1
>>     7     0     1
>>     3     0     1
>>     4     0     1
>>     9     0     1
>>     5     0     2
>>    11     0     2
>>     6     0     2
>>     5     0     2
>>     7     0     2
>>    13     0     3
>>    12     0     3
>>    10     0     3
>>    14     0     3
>>     9     0     3
>>    15     0     4
>>    19     0     4
>>    13     0     4
>>    17     0     4
>>    12     0     4
>>    15     1     1
>>    18     1     1
>>    14     1     1
>>    13     1     1
>>    15     1     1
>>    14     1     2
>>    17     1     2
>>    15     1     2
>>    11     1     2
>>    14     1     2
>>    16     1     3
>>    18     1     3
>>    19     1     3
>>    11     1     3
>>    14     1     3
>>    17     1     4
>>    15     1     4
>>    19     1     4
>>    14     1     4
>>    16     1     4
>> end data.
>>
>> * Run model via UNIANOVA .
>> UNIANOVA Y BY A B
>>  /CRITERIA=ALPHA(.05)
>>  /DESIGN=A B A*B.
>>
>> * Run model via MANOVA.
>> manova Y by A(0,1) B(1,4) /
>>  print=design/
>>  DESIGN=A B A by B.
>>
>> * Sums of Squares from UNIANOVA and MANOVA match.
>> * Now MANOVA with PARTITION to partition the A*B
>> * interaction into the linear, quadratic and cubic components.
>>
>> manova Y by A(0,1) B(1,4) /
>>  contrast(A)=poly/
>>  contrast(B)=poly/
>>  partition(B)=(1,1,1)/
>>  print=design/
>>  DESIGN=A B
>>  A by B(1)
>>  A by B(2)
>>  A by B(3)
>> .
>>
>> * In the model that was just run,
>> *   A BY B(1) = linear component of the interaction,
>> *   A BY B(2) = quadratic component of the interaction, and
>> *   A BY B(3) = cubic component of the interaction.
>>
>> * The SS for the linear, quadratic & cubic components sum to 99.40,
>> * the same value as SS(A*B) in the earlier runs.  Good! .
>>
>> * Now try partitioning into linear vs (quadratic + cubic).
>>
>> manova Y by A(0,1) B(1,4) /
>>  contrast(A)=poly/
>>  contrast(B)=poly/
>>  partition(B)=(1,2)/
>>  print=design/
>>  DESIGN=A B
>>  A by B(1)
>>  A by B(2)
>> .
>>
>> * In this model,
>> *   A BY B(1) = linear component of the interaction,
>> *   A BY B(2) = linear + cubic components of the interaction.
>>
>> * The SS for A * B(2) in this model is the sum of the SS
>> * for the quadratic & cubic components of the interaction in the
>> * previous run that partitioned the SS into 3 components, each with
>> * df = 1.  So all is well with the world.
>>
>>
>> * Try Ryan's MIXED with /TEST method.
>>
>> MIXED Y BY A B
>>  /FIXED=A B A*B | SSTYPE(3)
>>  /METHOD=REML
>>  /PRINT=SOLUTION
>>  /TEST = 'Linear Trend Interaction' A*B
>>          3  1 -1 -3
>>         -3 -1  1  3
>> .
>> * The t-value is comparable to what MANOVA gives for the linear component
>> * of the interaction.  But the value of the estimate is much larger.
>> * This is because MANOVA concocted a different set of contrast coefficients.
>> * Plug them into MIXED, and see if the estimated values become more similar.
>>
>> MIXED Y BY A B
>>  /FIXED=A B A*B | SSTYPE(3)
>>  /METHOD=REML
>>  /PRINT=SOLUTION
>>  /TEST = 'Linear Trend Interaction' A*B
>>         .47437  .15811 -.15811 -.47437
>>        -.47437 -.15811  .15811  .47437
>> .
>>
>> * Okay, good.  Now the contrasts from MANOVA and MIXED
>> * are very similar.
>>
>> * But one thing the MIXED output doesn't give me is the SS for
>> * the various components.  These are nice to have, because
>> * I can use them to work out the percentage of the interaction
>> * effect that is due to the linear by linear component.
>> * In this case, it would be 98.0 / 99.4 = 98.6%.
>>
>> * If MIXED can display SS in the "Tests of Fixed Effects"
>> * summary table, I can't find how to do it.
>>
>>
>>
>> -----
>> --
>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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
>>
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
In reply to this post by Bruce Weaver
Bruce (and others who might be interested),
My initial understanding was that you were interested in testing for a
linear trend interaction derived from a GLM model which included two
factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):
(Place the following in Notepad to see it correctly formatted)

                  B       1      2      3      4
---------------------------  1 | a1b1 | a1b2 | a1b3 | a1b4 |A
---------------------------  2 | a2b1 | a2b2 | a2b3 | a2b4 |
---------------------------

I responded by defining what I thought you were referring to with
respect to a linear trend interaction; that is, a formal test on the
interaction between the linear trends of a1 and a2 across B.
Concretely, we’re testing if the means of a1 and a2 consistently trend
in a linear fashion more closely or farther as they move along the
levels of B (b1 through b4), i.e.,
(Place the following in Notepad to see it correctly formatted)

     |       |  ^                * A   |       ^     *        |
*     ^     |  *                ^        ------------------------
  1     2     3     4                 B  where
^ = a1 means for each level of B* = a2 means for each level of B


In this type of scenario, one typically assumes that the categorical
variable B has ordinal properties. Anyway, it was at this point that I
decided to suggest that you construct an interaction linear trend test
via MIXED using orthogonal polynomials. If one were to construct a
linear trend interaction test for the model specified above via MIXED,
one would need to first determine appropriate coefficients of
orthogonal polynomials. Further to this point, to appropriately
construct linear trends for both a1 and a2, their coefficients should
be equally spaced and sum to zero, which for an even # of levels of B
for a1 and a2, would be computed by using:

-(k-1) to (k-1) in increments of 2

where k = # of levels of B

which results in

-3 -1 1 3

(I've seen this described in multiple locations online and in
textbooks which describe orthogonal polynomial contrasts for ANOVA
type designs)
To obtain the  value of the linear combination using the TEST
statement, we would write the following code:

/TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0

We could write out the linear combination ourselves by plugging in the
estimated parameters:

-3*(-1.1999999999999993)-1*(-1.9999999999999982)+1*(-.6)+3*(0)-3*(-8.2)-1*(-6.4)+1*(-3)-3*(0)+0*(0)+0*(0)+0*(0)+0*(0)=
33

By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we
are forcing the TEST statement to provide a formal test as to whether
there is a linear trend of a1 means across the four levels of B. But
“33” is the resulting value of summing the terms. What is the
estimated slope? If we wanted to obtain the slope of the linear trend,
then we would need to incorporate a divisor:

/TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0
0 0 DIVISOR=10

(If someone is interested in understanding how I arrived at the
DIVISOR of 10, feel free to ask. But I prefer to skip over this point
for the moment.)
The TEST statement above produces a slope estimate of the linear trend
for a=1 of 3.3. Although I haven’t tested this, for Bruce's example,
this slope value should be EXACTLY what you would obtain if you were
fit a standard linear regression treating the means of a1b1, a1b2,
a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
covariate. For a similar linear trend test of a=2 across B, we would
write:

/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1 1 3

/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3 -1 1
3 DIVISOR=10

Based on this approach, if one wanted to test whether there was a
significant interaction between the linear trends of a1 and a2 across
B, then we would to take the difference of the linear trend
coefficients:

-3 -1 1 3 - (-3 -1 1 3)

or when removing the parentheses and placing it in the design figure I
presented initially:
(Place this in Notepad to obtain correct formatting)

-3 -1  1  3   3  1 -1 -3
This, of course, leads to the TEST statement:

/TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
Note: It would take very little effort to test for a quadratic or
cubic trends via the TEST statements.
Anyway, I hope this shows how I arrived at my interaction linear trend
TEST statement. It may not be the optimal approach, but  it seems
valid given Bruce's initial request to construct an interaction linear
trend test based on his GLM design. Perhaps I've misunderstood exactly
what he's trying to test or perhaps there is simply a better approach
using another procedure.
HTH,
Ryan
On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:

> Bruce Weaver wrote:
>>
>> Yes, that's right.
>>
>> I forgot to mention when responding to your earlier post that another
>> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>> because in a balanced design, the SS for the polynomial components of the
>> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>> the case with MLE.
>>
>> I've still not had time to try either method--too many meetings.  Will get
>> to it later today or tomorrow.
>>
>> Cheers,
>> Bruce
>>
>>
>
> Okay, I finally had (or took) time to get back to this.  WARNING:  There is
> a fair bit of syntax here.  But anyone who is interested in the discussion
> we've been having here might be interested in working through the various
> examples.  I certainly have a better appreciation for how PARTITION works in
> MANOVA now!  ;-)
>
> Thanks again to Tony, Ryan & David.
>
>
> * Read in the data .
> data list list / Y A B (3f5.0).
> begin data
>     6     0     1
>     7     0     1
>     3     0     1
>     4     0     1
>     9     0     1
>     5     0     2
>    11     0     2
>     6     0     2
>     5     0     2
>     7     0     2
>    13     0     3
>    12     0     3
>    10     0     3
>    14     0     3
>     9     0     3
>    15     0     4
>    19     0     4
>    13     0     4
>    17     0     4
>    12     0     4
>    15     1     1
>    18     1     1
>    14     1     1
>    13     1     1
>    15     1     1
>    14     1     2
>    17     1     2
>    15     1     2
>    11     1     2
>    14     1     2
>    16     1     3
>    18     1     3
>    19     1     3
>    11     1     3
>    14     1     3
>    17     1     4
>    15     1     4
>    19     1     4
>    14     1     4
>    16     1     4
> end data.
>
> * Run model via UNIANOVA .
> UNIANOVA Y BY A B
>  /CRITERIA=ALPHA(.05)
>  /DESIGN=A B A*B.
>
> * Run model via MANOVA.
> manova Y by A(0,1) B(1,4) /
>  print=design/
>  DESIGN=A B A by B.
>
> * Sums of Squares from UNIANOVA and MANOVA match.
> * Now MANOVA with PARTITION to partition the A*B
> * interaction into the linear, quadratic and cubic components.
>
> manova Y by A(0,1) B(1,4) /
>  contrast(A)=poly/
>  contrast(B)=poly/
>  partition(B)=(1,1,1)/
>  print=design/
>  DESIGN=A B
>  A by B(1)
>  A by B(2)
>  A by B(3)
> .
>
> * In the model that was just run,
> *   A BY B(1) = linear component of the interaction,
> *   A BY B(2) = quadratic component of the interaction, and
> *   A BY B(3) = cubic component of the interaction.
>
> * The SS for the linear, quadratic & cubic components sum to 99.40,
> * the same value as SS(A*B) in the earlier runs.  Good! .
>
> * Now try partitioning into linear vs (quadratic + cubic).
>
> manova Y by A(0,1) B(1,4) /
>  contrast(A)=poly/
>  contrast(B)=poly/
>  partition(B)=(1,2)/
>  print=design/
>  DESIGN=A B
>  A by B(1)
>  A by B(2)
> .
>
> * In this model,
> *   A BY B(1) = linear component of the interaction,
> *   A BY B(2) = linear + cubic components of the interaction.
>
> * The SS for A * B(2) in this model is the sum of the SS
> * for the quadratic & cubic components of the interaction in the
> * previous run that partitioned the SS into 3 components, each with
> * df = 1.  So all is well with the world.
>
>
> * Try Ryan's MIXED with /TEST method.
>
> MIXED Y BY A B
>  /FIXED=A B A*B | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear Trend Interaction' A*B
>          3  1 -1 -3
>         -3 -1  1  3
> .
> * The t-value is comparable to what MANOVA gives for the linear component
> * of the interaction.  But the value of the estimate is much larger.
> * This is because MANOVA concocted a different set of contrast coefficients.
> * Plug them into MIXED, and see if the estimated values become more similar.
>
> MIXED Y BY A B
>  /FIXED=A B A*B | SSTYPE(3)
>  /METHOD=REML
>  /PRINT=SOLUTION
>  /TEST = 'Linear Trend Interaction' A*B
>         .47437  .15811 -.15811 -.47437
>        -.47437 -.15811  .15811  .47437
> .
>
> * Okay, good.  Now the contrasts from MANOVA and MIXED
> * are very similar.
>
> * But one thing the MIXED output doesn't give me is the SS for
> * the various components.  These are nice to have, because
> * I can use them to work out the percentage of the interaction
> * effect that is due to the linear by linear component.
> * In this case, it would be 98.0 / 99.4 = 98.6%.
>
> * If MIXED can display SS in the "Tests of Fixed Effects"
> * summary table, I can't find how to do it.
>
>
>
> -----
> --
> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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
>

=====================
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: Polynomial contrast for interaction in completely between-Ss design

Ryan
In reply to this post by Bruce Weaver
Last attempt:

Bruce (and others who might be interested),

My initial understanding was that you were interested in testing for a linear trend interaction derived from a GLM model which included two factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):

(Place the following in Notepad to see it correctly formatted)


                  B
       1      2      3      4      
     ---------------------------
  1 | a1b1 | a1b2 | a1b3 | a1b4 |
A    ---------------------------
  2 | a2b1 | a2b2 | a2b3 | a2b4 |
    ---------------------------


I responded by defining what I thought you were referring to with respect to a linear trend interaction; that is, a formal test on the interaction between the linear trends of a1 and a2 across B. Concretely, we’re testing if the means of a1 and a2 consistently trend in a linear fashion more closely or farther as they move along the levels of B (b1 through b4), i.e.,

(Place the following in Notepad to see it correctly formatted)


     |  
     |  ^                *
 A   |       ^     *   
     |       *     ^
     |  *                ^   
     ------------------------
        1     2     3     4
                 B
  
where  

^ = a1 means for each level of B
* = a2 means for each level of B



In this type of scenario, one typically assumes that the categorical variable B has ordinal properties. Anyway, it was at this point that I decided to suggest that you construct an interaction linear trend test via MIXED using orthogonal polynomials. If one were to construct a linear trend interaction test for the model specified above via MIXED, one would need to first determine appropriate coefficients of orthogonal polynomials. Further to this point, to appropriately construct linear trends for both a1 and a2, their coefficients should be equally spaced and sum to zero, which for an even # of levels of B for a1 and a2, would be computed by using: 


-(k-1) to (k-1) in increments of 2


where k = # of levels of B


which results in


-3 -1 1 3


(I've seen this described in multiple locations online and in textbooks which describe orthogonal polynomial contrasts for ANOVA type designs)

To obtain the  value of the linear combination using the TEST statement, we would write the following code:


/TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0


We could write out the linear combination ourselves by plugging in the estimated parameters:


-3*(-1.1999999999999993)
-1*(-1.9999999999999982)
+1*(-.6)
+3*(0)
-3*(-8.2)
-1*(-6.4)
+1*(-3)
-3*(0)
+0*(0)
+0*(0)
+0*(0)
+0*(0)= 33


By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we are forcing the TEST statement to provide a formal test as to whether there is a linear trend of a1 means across the four levels of B. But “33” is the resulting value of summing the terms. What is the estimated slope? If we wanted to obtain the slope of the linear trend, then we would need to incorporate a divisor:


/TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0 DIVISOR=10


(If someone is interested in understanding how I arrived at the DIVISOR of 10, feel free to ask. But I prefer to skip over this point for the moment.)

The TEST statement above produces a slope estimate of the linear trend for a=1 of 3.3. Although I haven’t tested this, for Bruce's example, this slope value should be EXACTLY what you would obtain if you were fit a standard linear regression treating the means of a1b1, a1b2, a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
covariate. For a similar linear trend test of a=2 across B, we would write:


/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1 1 3 


/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3 -1 1 3 DIVISOR=10


Based on this approach, if one wanted to test whether there was a significant interaction between the linear trends of a1 and a2 across B, then we would to take the difference of the linear trend coefficients:


-3 -1 1 3 - (-3 -1 1 3)


or when removing the parentheses and placing it in the design figure I presented initially:

(Place this in Notepad to obtain correct formatting)


-3 -1  1  3  
 3  1 -1 -3
 

This, of course, leads to the TEST statement:


/TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
 

Note: It would take very little effort to test for a quadratic or cubic trends via the TEST statements.

Anyway, I hope this shows how I arrived at my interaction linear trend TEST statement. It may not be the optimal approach, but  it seems valid given Bruce's initial request to construct an interaction linear trend test based on his GLM design. Perhaps I've misunderstood exactly what he's trying to test or perhaps there is simply a better approach using another procedure.

HTH,

Ryan

On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:
Bruce Weaver wrote:
>
> Yes, that's right.
>
> I forgot to mention when responding to your earlier post that another
> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
> because in a balanced design, the SS for the polynomial components of the
> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
> the case with MLE.
>
> I've still not had time to try either method--too many meetings.  Will get
> to it later today or tomorrow.
>
> Cheers,
> Bruce
>
>

Okay, I finally had (or took) time to get back to this.  WARNING:  There is
a fair bit of syntax here.  But anyone who is interested in the discussion
we've been having here might be interested in working through the various
examples.  I certainly have a better appreciation for how PARTITION works in
MANOVA now!  ;-)

Thanks again to Tony, Ryan & David.


* Read in the data .
data list list / Y A B (3f5.0).
begin data
    6     0     1
    7     0     1
    3     0     1
    4     0     1
    9     0     1
    5     0     2
   11     0     2
    6     0     2
    5     0     2
    7     0     2
   13     0     3
   12     0     3
   10     0     3
   14     0     3
    9     0     3
   15     0     4
   19     0     4
   13     0     4
   17     0     4
   12     0     4
   15     1     1
   18     1     1
   14     1     1
   13     1     1
   15     1     1
   14     1     2
   17     1     2
   15     1     2
   11     1     2
   14     1     2
   16     1     3
   18     1     3
   19     1     3
   11     1     3
   14     1     3
   17     1     4
   15     1     4
   19     1     4
   14     1     4
   16     1     4
end data.

* Run model via UNIANOVA .
UNIANOVA Y BY A B
 /CRITERIA=ALPHA(.05)
 /DESIGN=A B A*B.

* Run model via MANOVA.
manova Y by A(0,1) B(1,4) /
 print=design/
 DESIGN=A B A by B.

* Sums of Squares from UNIANOVA and MANOVA match.
* Now MANOVA with PARTITION to partition the A*B
* interaction into the linear, quadratic and cubic components.

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,1,1)/
 print=design/
 DESIGN=A B
 A by B(1)
 A by B(2)
 A by B(3)
.

* In the model that was just run,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = quadratic component of the interaction, and
*   A BY B(3) = cubic component of the interaction.

* The SS for the linear, quadratic & cubic components sum to 99.40,
* the same value as SS(A*B) in the earlier runs.  Good! .

* Now try partitioning into linear vs (quadratic + cubic).

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,2)/
 print=design/
 DESIGN=A B
 A by B(1)
 A by B(2)
.

* In this model,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = linear + cubic components of the interaction.

* The SS for A * B(2) in this model is the sum of the SS
* for the quadratic & cubic components of the interaction in the
* previous run that partitioned the SS into 3 components, each with
* df = 1.  So all is well with the world.


* Try Ryan's MIXED with /TEST method.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
         3  1 -1 -3
        -3 -1  1  3
.
* The t-value is comparable to what MANOVA gives for the linear component
* of the interaction.  But the value of the estimate is much larger.
* This is because MANOVA concocted a different set of contrast coefficients.
* Plug them into MIXED, and see if the estimated values become more similar.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
        .47437  .15811 -.15811 -.47437
       -.47437 -.15811  .15811  .47437
.

* Okay, good.  Now the contrasts from MANOVA and MIXED
* are very similar.

* But one thing the MIXED output doesn't give me is the SS for
* the various components.  These are nice to have, because
* I can use them to work out the percentage of the interaction
* effect that is due to the linear by linear component.
* In this case, it would be 98.0 / 99.4 = 98.6%.

* If MIXED can display SS in the "Tests of Fixed Effects"
* summary table, I can't find how to do it.



-----
--
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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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: Polynomial contrast for interaction in completely between-Ss design

Ryan
You should be able to view my post formatted correctly here:


Apologies for the multiple posts. 

Ryan

On Sat, Oct 29, 2011 at 12:09 PM, R B <[hidden email]> wrote:
Last attempt:

Bruce (and others who might be interested),

My initial understanding was that you were interested in testing for a linear trend interaction derived from a GLM model which included two factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):

(Place the following in Notepad to see it correctly formatted)


                  B
       1      2      3      4      
     ---------------------------
  1 | a1b1 | a1b2 | a1b3 | a1b4 |
A    ---------------------------
  2 | a2b1 | a2b2 | a2b3 | a2b4 |
    ---------------------------


I responded by defining what I thought you were referring to with respect to a linear trend interaction; that is, a formal test on the interaction between the linear trends of a1 and a2 across B. Concretely, we’re testing if the means of a1 and a2 consistently trend in a linear fashion more closely or farther as they move along the levels of B (b1 through b4), i.e.,

(Place the following in Notepad to see it correctly formatted)


     |  
     |  ^                *
 A   |       ^     *   
     |       *     ^
     |  *                ^   
     ------------------------
        1     2     3     4
                 B
  
where  

^ = a1 means for each level of B
* = a2 means for each level of B



In this type of scenario, one typically assumes that the categorical variable B has ordinal properties. Anyway, it was at this point that I decided to suggest that you construct an interaction linear trend test via MIXED using orthogonal polynomials. If one were to construct a linear trend interaction test for the model specified above via MIXED, one would need to first determine appropriate coefficients of orthogonal polynomials. Further to this point, to appropriately construct linear trends for both a1 and a2, their coefficients should be equally spaced and sum to zero, which for an even # of levels of B for a1 and a2, would be computed by using: 


-(k-1) to (k-1) in increments of 2


where k = # of levels of B


which results in


-3 -1 1 3


(I've seen this described in multiple locations online and in textbooks which describe orthogonal polynomial contrasts for ANOVA type designs)

To obtain the  value of the linear combination using the TEST statement, we would write the following code:


/TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0


We could write out the linear combination ourselves by plugging in the estimated parameters:


-3*(-1.1999999999999993)
-1*(-1.9999999999999982)
+1*(-.6)
+3*(0)
-3*(-8.2)
-1*(-6.4)
+1*(-3)
-3*(0)
+0*(0)
+0*(0)
+0*(0)
+0*(0)= 33


By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we are forcing the TEST statement to provide a formal test as to whether there is a linear trend of a1 means across the four levels of B. But “33” is the resulting value of summing the terms. What is the estimated slope? If we wanted to obtain the slope of the linear trend, then we would need to incorporate a divisor:


/TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0 DIVISOR=10


(If someone is interested in understanding how I arrived at the DIVISOR of 10, feel free to ask. But I prefer to skip over this point for the moment.)

The TEST statement above produces a slope estimate of the linear trend for a=1 of 3.3. Although I haven’t tested this, for Bruce's example, this slope value should be EXACTLY what you would obtain if you were fit a standard linear regression treating the means of a1b1, a1b2, a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
covariate. For a similar linear trend test of a=2 across B, we would write:


/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1 1 3 


/TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3 -1 1 3 DIVISOR=10


Based on this approach, if one wanted to test whether there was a significant interaction between the linear trends of a1 and a2 across B, then we would to take the difference of the linear trend coefficients:


-3 -1 1 3 - (-3 -1 1 3)


or when removing the parentheses and placing it in the design figure I presented initially:

(Place this in Notepad to obtain correct formatting)


-3 -1  1  3  
 3  1 -1 -3
 

This, of course, leads to the TEST statement:


/TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
 

Note: It would take very little effort to test for a quadratic or cubic trends via the TEST statements.

Anyway, I hope this shows how I arrived at my interaction linear trend TEST statement. It may not be the optimal approach, but  it seems valid given Bruce's initial request to construct an interaction linear trend test based on his GLM design. Perhaps I've misunderstood exactly what he's trying to test or perhaps there is simply a better approach using another procedure.

HTH,

Ryan

On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:
Bruce Weaver wrote:
>
> Yes, that's right.
>
> I forgot to mention when responding to your earlier post that another
> reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
> because in a balanced design, the SS for the polynomial components of the
> A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
> the case with MLE.
>
> I've still not had time to try either method--too many meetings.  Will get
> to it later today or tomorrow.
>
> Cheers,
> Bruce
>
>

Okay, I finally had (or took) time to get back to this.  WARNING:  There is
a fair bit of syntax here.  But anyone who is interested in the discussion
we've been having here might be interested in working through the various
examples.  I certainly have a better appreciation for how PARTITION works in
MANOVA now!  ;-)

Thanks again to Tony, Ryan & David.


* Read in the data .
data list list / Y A B (3f5.0).
begin data
    6     0     1
    7     0     1
    3     0     1
    4     0     1
    9     0     1
    5     0     2
   11     0     2
    6     0     2
    5     0     2
    7     0     2
   13     0     3
   12     0     3
   10     0     3
   14     0     3
    9     0     3
   15     0     4
   19     0     4
   13     0     4
   17     0     4
   12     0     4
   15     1     1
   18     1     1
   14     1     1
   13     1     1
   15     1     1
   14     1     2
   17     1     2
   15     1     2
   11     1     2
   14     1     2
   16     1     3
   18     1     3
   19     1     3
   11     1     3
   14     1     3
   17     1     4
   15     1     4
   19     1     4
   14     1     4
   16     1     4
end data.

* Run model via UNIANOVA .
UNIANOVA Y BY A B
 /CRITERIA=ALPHA(.05)
 /DESIGN=A B A*B.

* Run model via MANOVA.
manova Y by A(0,1) B(1,4) /
 print=design/
 DESIGN=A B A by B.

* Sums of Squares from UNIANOVA and MANOVA match.
* Now MANOVA with PARTITION to partition the A*B
* interaction into the linear, quadratic and cubic components.

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,1,1)/
 print=design/
 DESIGN=A B
 A by B(1)
 A by B(2)
 A by B(3)
.

* In the model that was just run,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = quadratic component of the interaction, and
*   A BY B(3) = cubic component of the interaction.

* The SS for the linear, quadratic & cubic components sum to 99.40,
* the same value as SS(A*B) in the earlier runs.  Good! .

* Now try partitioning into linear vs (quadratic + cubic).

manova Y by A(0,1) B(1,4) /
 contrast(A)=poly/
 contrast(B)=poly/
 partition(B)=(1,2)/
 print=design/
 DESIGN=A B
 A by B(1)
 A by B(2)
.

* In this model,
*   A BY B(1) = linear component of the interaction,
*   A BY B(2) = linear + cubic components of the interaction.

* The SS for A * B(2) in this model is the sum of the SS
* for the quadratic & cubic components of the interaction in the
* previous run that partitioned the SS into 3 components, each with
* df = 1.  So all is well with the world.


* Try Ryan's MIXED with /TEST method.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
         3  1 -1 -3
        -3 -1  1  3
.
* The t-value is comparable to what MANOVA gives for the linear component
* of the interaction.  But the value of the estimate is much larger.
* This is because MANOVA concocted a different set of contrast coefficients.
* Plug them into MIXED, and see if the estimated values become more similar.

MIXED Y BY A B
 /FIXED=A B A*B | SSTYPE(3)
 /METHOD=REML
 /PRINT=SOLUTION
 /TEST = 'Linear Trend Interaction' A*B
        .47437  .15811 -.15811 -.47437
       -.47437 -.15811  .15811  .47437
.

* Okay, good.  Now the contrasts from MANOVA and MIXED
* are very similar.

* But one thing the MIXED output doesn't give me is the SS for
* the various components.  These are nice to have, because
* I can use them to work out the percentage of the interaction
* effect that is due to the linear by linear component.
* In this case, it would be 98.0 / 99.4 = 98.6%.

* If MIXED can display SS in the "Tests of Fixed Effects"
* summary table, I can't find how to do it.



-----
--
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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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: Polynomial contrast for interaction in completely between-Ss design

Ryan
Ok. I'm sorry, but I must make another point. With respect to Bruce's design, it is possible conduct the same interaction linear trend test that I previously proposed via the GLM procedure by invoking the LMATRIX sub-command:

GLM Y BY A B
 /PRINT = PARAMETER
 /DESIGN = A B A*B
 /LMATRIX = 'Interaction Linear Trend' A*B -3 -1 1 3 3 1 -1 -3.

Ryan

On Sat, Oct 29, 2011 at 12:11 PM, R B <[hidden email]> wrote:
>
> You should be able to view my post formatted correctly here:
> http://listserv.uga.edu/cgi-bin/wa?A2=ind1110&L=spssx-l&P=R73835
> Apologies for the multiple posts. 
> Ryan
>
> On Sat, Oct 29, 2011 at 12:09 PM, R B <[hidden email]> wrote:
>>
>> Last attempt:
>>
>> Bruce (and others who might be interested),
>> My initial understanding was that you were interested in testing for a linear trend interaction derived from a GLM model which included two factors: A (2 levels: a1 and a2) and B (4 levels: b1, b2, b3, b4):
>> (Place the following in Notepad to see it correctly formatted)
>>
>>                   B
>>        1      2      3      4      
>>      ---------------------------
>>   1 | a1b1 | a1b2 | a1b3 | a1b4 |
>> A    ---------------------------
>>   2 | a2b1 | a2b2 | a2b3 | a2b4 |
>>     ---------------------------
>>
>> I responded by defining what I thought you were referring to with respect to a linear trend interaction; that is, a formal test on the interaction between the linear trends of a1 and a2 across B. Concretely, we’re testing if the means of a1 and a2 consistently trend in a linear fashion more closely or farther as they move along the levels of B (b1 through b4), i.e.,
>> (Place the following in Notepad to see it correctly formatted)
>>
>>      |  
>>      |  ^                *
>>  A   |       ^     *   
>>      |       *     ^
>>      |  *                ^   
>>      ------------------------
>>         1     2     3     4
>>                  B
>>   
>> where  
>> ^ = a1 means for each level of B
>> * = a2 means for each level of B
>>
>>
>> In this type of scenario, one typically assumes that the categorical variable B has ordinal properties. Anyway, it was at this point that I decided to suggest that you construct an interaction linear trend test via MIXED using orthogonal polynomials. If one were to construct a linear trend interaction test for the model specified above via MIXED, one would need to first determine appropriate coefficients of orthogonal polynomials. Further to this point, to appropriately construct linear trends for both a1 and a2, their coefficients should be equally spaced and sum to zero, which for an even # of levels of B for a1 and a2, would be computed by using: 
>>
>> -(k-1) to (k-1) in increments of 2
>>
>> where k = # of levels of B
>>
>> which results in
>>
>> -3 -1 1 3
>>
>> (I've seen this described in multiple locations online and in textbooks which describe orthogonal polynomial contrasts for ANOVA type designs)
>> To obtain the  value of the linear combination using the TEST statement, we would write the following code:
>>
>> /TEST = 'Linear Trend for a=1' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0
>>
>> We could write out the linear combination ourselves by plugging in the estimated parameters:
>>
>> -3*(-1.1999999999999993)
>> -1*(-1.9999999999999982)
>> +1*(-.6)
>> +3*(0)
>> -3*(-8.2)
>> -1*(-6.4)
>> +1*(-3)
>> -3*(0)
>> +0*(0)
>> +0*(0)
>> +0*(0)
>> +0*(0)= 33
>>
>> By applying these linear trend coefficients (-3 -1 1 3 0 0 0 0), we are forcing the TEST statement to provide a formal test as to whether there is a linear trend of a1 means across the four levels of B. But “33” is the resulting value of summing the terms. What is the estimated slope? If we wanted to obtain the slope of the linear trend, then we would need to incorporate a divisor:
>>
>> /TEST = 'Linear Trend a=1 Expectation' B -3 -1 1 3 A*B -3  -1 1 3 0 0 0 0 DIVISOR=10
>>
>> (If someone is interested in understanding how I arrived at the DIVISOR of 10, feel free to ask. But I prefer to skip over this point for the moment.)
>> The TEST statement above produces a slope estimate of the linear trend for a=1 of 3.3. Although I haven’t tested this, for Bruce's example, this slope value should be EXACTLY what you would obtain if you were fit a standard linear regression treating the means of a1b1, a1b2, a1b3, and a1b4 as the dependent variable and B (1, 2, 3, 4) as a
>> covariate. For a similar linear trend test of a=2 across B, we would write:
>>
>> /TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3  -1 1 3 
>>
>> /TEST = 'Linear Trend a=2 Expectation' B -3 -1 1 3 A*B 0 0 0 0 -3 -1 1 3 DIVISOR=10
>>
>> Based on this approach, if one wanted to test whether there was a significant interaction between the linear trends of a1 and a2 across B, then we would to take the difference of the linear trend coefficients:
>>
>> -3 -1 1 3 - (-3 -1 1 3)
>>
>> or when removing the parentheses and placing it in the design figure I presented initially:
>> (Place this in Notepad to obtain correct formatting)
>>
>> -3 -1  1  3  
>>  3  1 -1 -3
>>  
>> This, of course, leads to the TEST statement:
>>
>> /TEST = 'Linear Trend Interaction' A*B -3 -1 1 3 3 1 -1 -3
>>  
>> Note: It would take very little effort to test for a quadratic or cubic trends via the TEST statements.
>> Anyway, I hope this shows how I arrived at my interaction linear trend TEST statement. It may not be the optimal approach, but  it seems valid given Bruce's initial request to construct an interaction linear trend test based on his GLM design. Perhaps I've misunderstood exactly what he's trying to test or perhaps there is simply a better approach using another procedure.
>> HTH,
>> Ryan
>> On Fri, Oct 28, 2011 at 3:45 PM, Bruce Weaver <[hidden email]> wrote:
>>>
>>> Bruce Weaver wrote:
>>> >
>>> > Yes, that's right.
>>> >
>>> > I forgot to mention when responding to your earlier post that another
>>> > reason for not using MIXED (with TEST) was that I preferred OLS to MLE,
>>> > because in a balanced design, the SS for the polynomial components of the
>>> > A*B interaction will add up exactly to the SS(A*B).  I doubt that will be
>>> > the case with MLE.
>>> >
>>> > I've still not had time to try either method--too many meetings.  Will get
>>> > to it later today or tomorrow.
>>> >
>>> > Cheers,
>>> > Bruce
>>> >
>>> >
>>>
>>> Okay, I finally had (or took) time to get back to this.  WARNING:  There is
>>> a fair bit of syntax here.  But anyone who is interested in the discussion
>>> we've been having here might be interested in working through the various
>>> examples.  I certainly have a better appreciation for how PARTITION works in
>>> MANOVA now!  ;-)
>>>
>>> Thanks again to Tony, Ryan & David.
>>>
>>>
>>> * Read in the data .
>>> data list list / Y A B (3f5.0).
>>> begin data
>>>     6     0     1
>>>     7     0     1
>>>     3     0     1
>>>     4     0     1
>>>     9     0     1
>>>     5     0     2
>>>    11     0     2
>>>     6     0     2
>>>     5     0     2
>>>     7     0     2
>>>    13     0     3
>>>    12     0     3
>>>    10     0     3
>>>    14     0     3
>>>     9     0     3
>>>    15     0     4
>>>    19     0     4
>>>    13     0     4
>>>    17     0     4
>>>    12     0     4
>>>    15     1     1
>>>    18     1     1
>>>    14     1     1
>>>    13     1     1
>>>    15     1     1
>>>    14     1     2
>>>    17     1     2
>>>    15     1     2
>>>    11     1     2
>>>    14     1     2
>>>    16     1     3
>>>    18     1     3
>>>    19     1     3
>>>    11     1     3
>>>    14     1     3
>>>    17     1     4
>>>    15     1     4
>>>    19     1     4
>>>    14     1     4
>>>    16     1     4
>>> end data.
>>>
>>> * Run model via UNIANOVA .
>>> UNIANOVA Y BY A B
>>>  /CRITERIA=ALPHA(.05)
>>>  /DESIGN=A B A*B.
>>>
>>> * Run model via MANOVA.
>>> manova Y by A(0,1) B(1,4) /
>>>  print=design/
>>>  DESIGN=A B A by B.
>>>
>>> * Sums of Squares from UNIANOVA and MANOVA match.
>>> * Now MANOVA with PARTITION to partition the A*B
>>> * interaction into the linear, quadratic and cubic components.
>>>
>>> manova Y by A(0,1) B(1,4) /
>>>  contrast(A)=poly/
>>>  contrast(B)=poly/
>>>  partition(B)=(1,1,1)/
>>>  print=design/
>>>  DESIGN=A B
>>>  A by B(1)
>>>  A by B(2)
>>>  A by B(3)
>>> .
>>>
>>> * In the model that was just run,
>>> *   A BY B(1) = linear component of the interaction,
>>> *   A BY B(2) = quadratic component of the interaction, and
>>> *   A BY B(3) = cubic component of the interaction.
>>>
>>> * The SS for the linear, quadratic & cubic components sum to 99.40,
>>> * the same value as SS(A*B) in the earlier runs.  Good! .
>>>
>>> * Now try partitioning into linear vs (quadratic + cubic).
>>>
>>> manova Y by A(0,1) B(1,4) /
>>>  contrast(A)=poly/
>>>  contrast(B)=poly/
>>>  partition(B)=(1,2)/
>>>  print=design/
>>>  DESIGN=A B
>>>  A by B(1)
>>>  A by B(2)
>>> .
>>>
>>> * In this model,
>>> *   A BY B(1) = linear component of the interaction,
>>> *   A BY B(2) = linear + cubic components of the interaction.
>>>
>>> * The SS for A * B(2) in this model is the sum of the SS
>>> * for the quadratic & cubic components of the interaction in the
>>> * previous run that partitioned the SS into 3 components, each with
>>> * df = 1.  So all is well with the world.
>>>
>>>
>>> * Try Ryan's MIXED with /TEST method.
>>>
>>> MIXED Y BY A B
>>>  /FIXED=A B A*B | SSTYPE(3)
>>>  /METHOD=REML
>>>  /PRINT=SOLUTION
>>>  /TEST = 'Linear Trend Interaction' A*B
>>>          3  1 -1 -3
>>>         -3 -1  1  3
>>> .
>>> * The t-value is comparable to what MANOVA gives for the linear component
>>> * of the interaction.  But the value of the estimate is much larger.
>>> * This is because MANOVA concocted a different set of contrast coefficients.
>>> * Plug them into MIXED, and see if the estimated values become more similar.
>>>
>>> MIXED Y BY A B
>>>  /FIXED=A B A*B | SSTYPE(3)
>>>  /METHOD=REML
>>>  /PRINT=SOLUTION
>>>  /TEST = 'Linear Trend Interaction' A*B
>>>         .47437  .15811 -.15811 -.47437
>>>        -.47437 -.15811  .15811  .47437
>>> .
>>>
>>> * Okay, good.  Now the contrasts from MANOVA and MIXED
>>> * are very similar.
>>>
>>> * But one thing the MIXED output doesn't give me is the SS for
>>> * the various components.  These are nice to have, because
>>> * I can use them to work out the percentage of the interaction
>>> * effect that is due to the linear by linear component.
>>> * In this case, it would be 98.0 / 99.4 = 98.6%.
>>>
>>> * If MIXED can display SS in the "Tests of Fixed Effects"
>>> * summary table, I can't find how to do it.
>>>
>>>
>>>
>>> -----
>>> --
>>> 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/Polynomial-contrast-for-interaction-in-completely-between-Ss-design-tp4941355p4947126.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
>>
>

12