planned contrasts 2x2 repeated measure design

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

planned contrasts 2x2 repeated measure design

torstenh
Hi All,
I have been pointed to this forum to look for an answer to my question - however previous questions/answers did not help.

I'm looking for a way to conduct a repeated measure analysis with predefined (planned) contrasts.

I have 4 variables (A1, A2, B1, B2) reflecting a 2x2 within subject design (factors are A vs. B and 1 vs 2).
I'm expecting the following specific pattern for A1 A2 B1 B2:   1  1  0  -2

Can anyone help me to figure that out or point me to some help.


-------------------------
If this were a between-subject design I would use the following syntax to test the focal contrast and the two orthogonal contrasts:

GLM dv BY condition
 /METHOD = SSTYPE(3)
 /INTERCEPT = INCLUDE
 /PRINT = DESCRIPTIVE ETASQ
 /LMATRIX = "1, 1, 0, -2" condition 1 1 0 -2
 /LMATRIX = "-1, 1, 0, 0" condition -1 1 0 0
 /LMATRIX = "1, 1, -3, 1" condition 1 1 -3 1
 /CRITERIA = ALPHA(.05)
 /DESIGN = condition.

A simple solution would be to restructure my 4 variables into 1 and enter a condition variable (1-4) to use the code above. However, I guess I would violate some rules with that (e.g., I would use an analysis that expects measures to be independent - which they are not as it is a within-subject design).
Am I right with this - or could I just restructure the data and use the code above???

I'm thankful for any comments.
Torsten
Reply | Threaded
Open this post in threaded view
|

Re: planned contrasts 2x2 repeated measure design

Ryan
Let's start with the design matrix. Is the depiction below an accurate reflection of your SxAxB design?
 
 
                 B1            B2
             ---------     ---------
             A1     A2     A1     A2
Subjects
------------------------------------
1            B1A1 B1A2     B2A1 B2A2
2            B1A1 B1A2     B2A1 B2A2
3            B1A1 B1A2     B2A1 B2A2
4            B1A1 B1A2     B2A1 B2A2
.
.
.
------------------------------------
 
Correct the depiction above such that it matches your study design, think about the depiction; from there, determine your desired contrast.
 
Are you certain it is as you have stated?:
 
"A1 A2 B1 B2:   1  1  0  -2"
 
Ryan
 


On Mon, May 13, 2013 at 6:00 AM, torstenh <[hidden email]> wrote:
Hi All,
I have been pointed to this forum to look for an answer to my question -
however previous questions/answers did not help.

I'm looking for a way to conduct a repeated measure analysis with predefined
(planned) contrasts.

I have 4 variables (A1, A2, B1, B2) reflecting a 2x2 within subject design
(factors are A vs. B and 1 vs 2).
I'm expecting the following specific pattern for A1 A2 B1 B2:   1  1  0  -2

Can anyone help me to figure that out or point me to some help.


-------------------------
If this were a between-subject design I would use the following syntax to
test the focal contrast and the two orthogonal contrasts:

GLM dv BY condition
 /METHOD = SSTYPE(3)
 /INTERCEPT = INCLUDE
 /PRINT = DESCRIPTIVE ETASQ
 /LMATRIX = "1, 1, 0, -2" condition 1 1 0 -2
 /LMATRIX = "-1, 1, 0, 0" condition -1 1 0 0
 /LMATRIX = "1, 1, -3, 1" condition 1 1 -3 1
 /CRITERIA = ALPHA(.05)
 /DESIGN = condition.

A simple solution would be to restructure my 4 variables into 1 and enter a
condition variable (1-4) to use the code above. However, I guess I would
violate some rules with that (e.g., I would use an analysis that expects
measures to be independent - which they are not as it is a within-subject
design).
Am I right with this - or could I just restructure the data and use the code
above???

I'm thankful for any comments.
Torsten




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-tp5720203.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: planned contrasts 2x2 repeated measure design

torstenh
Hi Ryan,
yes, your matrix is correct. I "translated" it into the real names (to make sure it is correct and it's easier to understand for me):

                   target                              distractor
    --------------------------------------    --------------------------------------
    compatible    incompatible    compatible    incompatible


Subjects
------------------------------------
1    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
2    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
3    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
4    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
(...)
------------------------------------
 
These are the specific hypotheses that I need to test with one contrast:
1) "distractors" should have a lower value than "targets"
2) "incomp" should have a lower value then "comp" - but should only affect "distractors"!

target(comp)    target(incomp)    distractor(comp)    distractor(incomp)
        1                     1                         0                         -2

I'm excited to hear what you suggest now,
Torsten

Reply | Threaded
Open this post in threaded view
|

Re: planned contrasts 2x2 repeated measure design

Ryan
Now we are off to the races. Unfortunately, I'm *extremely* busy. If someone else does not jump in, I will try to respond within the next couple of days.
 
Ryan


On Tue, May 14, 2013 at 7:18 AM, torstenh <[hidden email]> wrote:
Hi Ryan,
yes, your matrix is correct. I "translated" it into the real names (to make
sure it is correct and it's easier to understand for me):

                   target                              distractor
    --------------------------------------
--------------------------------------
    compatible    incompatible    compatible    incompatible


Subjects
------------------------------------
1    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
2    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
3    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
4    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
(...)
------------------------------------

These are the specific hypotheses that I need to test with one contrast:
1) "distractors" should have a lower value than "targets"
2) "incomp" should have a lower value then "comp" - but should only affect
"distractors"!

target(comp)    target(incomp)    distractor(comp)    distractor(incomp)
        1                     1                         0
-2

I'm excited to hear what you suggest now,
Torsten





--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-tp5720203p5720233.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
|

CTABLES sort...force "Other" to bottom

King Douglas
In reply to this post by torstenh
Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
  /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
  /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
    POSITION=AFTER.

* MR VARIABLE.


MRSETS
  /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
  /DISPLAY NAME=[$Flavor].

CTABLES
  /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
  /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
    POSITION=AFTER.

=====================
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: CTABLES sort...force "Other" to bottom

Jon K Peck
You can, of course, dictate the order of the category list on the CTABLES CATEGORIES subcommand.  If you want a fixed order with Other as an exception and most of the category lists are the same, that would be the easiest thing to do.

However, if you want categories listed in ascending or descending count order, you can use the function genCategoryList in the spssaux2.py module from the SPSS Community site to build a set of macros that can be used in the CTABLES commands.  It takes an "exception" list for items such as Other that should be moved to the head or tail of the list.

So, the net is that you would run this function or something like it to generate the requisite macros and then use those in the CATEGORIES category list fields.  While this function sorts by counts, it would be simple to create one that sorted by values or value labels.

HTH,

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        King Douglas <[hidden email]>
To:        [hidden email],
Date:        05/14/2013 06:48 AM
Subject:        [SPSSX-L] CTABLES sort...force "Other" to bottom
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
 /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
 /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
 /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
   POSITION=AFTER.

* MR VARIABLE.


MRSETS
 /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
 /DISPLAY NAME=[$Flavor].

CTABLES
 /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
 /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
   POSITION=AFTER.

=====================
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: CTABLES sort...force "Other" to bottom

vlad simion
In reply to this post by King Douglas
Hi King,

For the single answer case try something like this:

compute cnt=1.
if flavor1=4 cnt=-1.
set CCA=',,,'.
format cnt (CCA4).
CTABLES
  /VLABELS VARIABLES=cnt flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [C] BY cnt [COUNT F40.0, COLPCT.COUNT PCT40.1, SUM]
  /CATEGORIES VARIABLES=flavor1 ORDER=D KEY=SUM(cnt) EMPTY=INCLUDE TOTAL=YES POSITION=AFTER.

you would still have to suppress the 'sum' column from the table.

I would be interested if there is a workaround with plain syntax or macros for the group case.

Hth,
Vlad


On Tue, May 14, 2013 at 3:41 PM, King Douglas <[hidden email]> wrote:
Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
  /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
  /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
    POSITION=AFTER.

* MR VARIABLE.


MRSETS
  /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
  /DISPLAY NAME=[$Flavor].

CTABLES
  /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
  /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
    POSITION=AFTER.

=====================
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: CTABLES sort...force "Other" to bottom

King Douglas
vlad,

Your solution for the single variable table suits my needs very well...thank you!  

I've been experimenting with the MR table, taking your idea of the cnt variable as a starting point, but no luck so far. 

Regards,

King Douglas

From: vlad simion <[hidden email]>
To: [hidden email]
Cc: SPSS discussion list <[hidden email]>
Sent: Tue, May 14, 2013 9:50:21 AM
Subject: Re: CTABLES sort...force "Other" to bottom

Hi King,

For the single answer case try something like this:

compute cnt=1.
if flavor1=4 cnt=-1.
set CCA=',,,'.
format cnt (CCA4).
CTABLES
  /VLABELS VARIABLES=cnt flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [C] BY cnt [COUNT F40.0, COLPCT.COUNT PCT40.1, SUM]
  /CATEGORIES VARIABLES=flavor1 ORDER=D KEY=SUM(cnt) EMPTY=INCLUDE TOTAL=YES POSITION=AFTER.

you would still have to suppress the 'sum' column from the table.

I would be interested if there is a workaround with plain syntax or macros for the group case.

Hth,
Vlad


On Tue, May 14, 2013 at 3:41 PM, King Douglas <[hidden email]> wrote:
Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
  /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
  /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
    POSITION=AFTER.

* MR VARIABLE.


MRSETS
  /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
  /DISPLAY NAME=[$Flavor].

CTABLES
  /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
  /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
    POSITION=AFTER.

=====================
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: planned contrasts 2x2 repeated measure design

Ryan
In reply to this post by torstenh
Torsten,
 
Below is an example that I just made up demonstrating how to fit a two-way repeated measures ANOVA using a general linear model in wide format and long format (examine the DESIGN statement to see how the variance is partitioned). I then go on to show how to use the linear mixed model (MIXED procedure) can be employed. I also provide several TEST statements of the MIXED procedure which lead up to addressing your first and second contrast. I do not have time to elaborate on the code, but I hope that upon examination you will begin to see how that single contrast you posted is not going to address either of your two scientific hypotheses. Even if I have misunderstood your contrast(s) of interest, I still think you will learn a great deal from the code below which should help you construct whatever contrast(s) of interest you desire.
 
Important point: You need to adjust your dataset such that it matches the variables I have below. The correct order is critical.
 
Best wishes,
 
Ryan
--
 
data list list / Subject B1A1 B1A2 B2A1 B2A2.
begin data
 1 9.2 7.5 6.4 7.3 
 2 8.3 6.2 5.4 7.1 
 3 8.6 7.2 4.4 8.4 
 4 8.4 4.2 1.4 2.5 
 5 8.9 6.2 1.1 2.3 
end data.
 
GLM B1A1 B1A2 B2A1 B2A2
  /WSFACTOR=B 2 Polynomial A 2 Polynomial
  /METHOD=SSTYPE(3)
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=B A B*A.
 
VARSTOCASES
  /MAKE y FROM B1A1 B1A2 B2A1 B2A2
  /INDEX=B(2) A(2)
  /NULL=KEEP.
 
UNIANOVA y BY A B Subject
  /RANDOM=Subject
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /CRITERIA=ALPHA(0.05)
  /DESIGN=Subject A Subject*A B Subject*B A*B.
 
MIXED y BY B A
 /FIXED = B A B*A
 /REPEATED = A*B | SUBJECT(Subject) COVTYPE(UN)
 /PRINT SOLUTION
 /TEST 'mean(B1A1)' intercept 1 B 1 0 A 1 0 B*A 1 0 0 0
 /TEST 'mean(B1A2)' intercept 1 B 1 0 A 0 1 B*A 0 1 0 0
 /TEST 'mean(B2A1)' intercept 1 B 0 1 A 1 0 B*A 0 0 1 0
 /TEST 'mean(B2A2)' intercept 1 B 0 1 A 0 1 B*A 0 0 0 1
 /TEST 'mean(B1A1,B1A2)' intercept 2 B 2 0 A 1 1 B*A 1 1 0 0 DIVISOR=2
 /TEST 'mean(B2A1,B2A2)' intercept 2 B 0 2 A 1 1 B*A 0 0 1 1 DIVISOR=2
 /TEST '1st contrast: mean(B1A1,B1A2) MINUS mean(B2A1,B2A2)'  B 2 -2 B*A 1 1 -1 -1 DIVISOR=2
 /TEST 'mean(B1A1) MINUS mean(B1A2)' A 1 -1 B*A 1 -1 0 0
 /TEST '2nd contrast: mean (B2A1) MINUS mean(B2A2)' A 1 -1 B*A 0 0 1 -1
 /TEST 'diff of diff' B*A 1 -1 -1 1.


On Tue, May 14, 2013 at 7:18 AM, torstenh <[hidden email]> wrote:
Hi Ryan,
yes, your matrix is correct. I "translated" it into the real names (to make
sure it is correct and it's easier to understand for me):

                   target                              distractor
    --------------------------------------
--------------------------------------
    compatible    incompatible    compatible    incompatible


Subjects
------------------------------------
1    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
2    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
3    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
4    target(comp)    target(incomp)   distractor(comp)    distractor(incomp)
(...)
------------------------------------

These are the specific hypotheses that I need to test with one contrast:
1) "distractors" should have a lower value than "targets"
2) "incomp" should have a lower value then "comp" - but should only affect
"distractors"!

target(comp)    target(incomp)    distractor(comp)    distractor(incomp)
        1                     1                         0
-2

I'm excited to hear what you suggest now,
Torsten





--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-tp5720203p5720233.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: CTABLES sort...force "Other" to bottom

King Douglas
In reply to this post by Jon K Peck

Thanks, Jon,

 

I’m looking for a backwards-compatible solution that doesn’t call for Python as I’m helping someone with an older version of SPSS.  Vlad Simion solved the problem for the single-variable case, but I’m still looking for a solution for multiple-response variables.

 

I may extend my Python skills by working on the nifty genCategoryList solution you suggest, modifying the macro to sort on column percentages with the exception of the value for “Other.”  In the meantime, a simple Excel macro is handling the sorting after exporting the tables…not what I want, but it works.

 

Regards,

 

King

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: Tuesday, May 14, 2013 8:17 AM
To: [hidden email]
Subject: Re: CTABLES sort...force "Other" to bottom

 

You can, of course, dictate the order of the category list on the CTABLES CATEGORIES subcommand.  If you want a fixed order with Other as an exception and most of the category lists are the same, that would be the easiest thing to do.

However, if you want categories listed in ascending or descending count order, you can use the function genCategoryList in the spssaux2.py module from the SPSS Community site to build a set of macros that can be used in the CTABLES commands.  It takes an "exception" list for items such as Other that should be moved to the head or tail of the list.

So, the net is that you would run this function or something like it to generate the requisite macros and then use those in the CATEGORIES category list fields.  While this function sorts by counts, it would be simple to create one that sorted by values or value labels.

HTH,

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        King Douglas <[hidden email]>
To:        [hidden email],
Date:        05/14/2013 06:48 AM
Subject:        [SPSSX-L] CTABLES sort...force "Other" to bottom
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
 /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
 /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
 /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
   POSITION=AFTER.

* MR VARIABLE.


MRSETS
 /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
 /DISPLAY NAME=[$Flavor].

CTABLES
 /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
 /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
   POSITION=AFTER.

=====================
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: planned contrasts 2x2 repeated measure design

torstenh
In reply to this post by Ryan
Ryan,
I will start digging into your code and try to figure it out.
Thanks a lot for your effort and time,
Torsten
Reply | Threaded
Open this post in threaded view
|

Re: CTABLES sort...force "Other" to bottom

Kirill Orlov
In reply to this post by King Douglas
Hi King,
I guess the solution with MRset should be basically the same as adviced to you with single variable.
Only nuance is that instead of assigning the cnt variable -1 or 1 value you will have to COUNT it = how many times "other" is encountered within a case.


15.05.2013 15:15, King Douglas пишет:

Thanks, Jon,

 

I’m looking for a backwards-compatible solution that doesn’t call for Python as I’m helping someone with an older version of SPSS.  Vlad Simion solved the problem for the single-variable case, but I’m still looking for a solution for multiple-response variables.

 

I may extend my Python skills by working on the nifty genCategoryList solution you suggest, modifying the macro to sort on column percentages with the exception of the value for “Other.”  In the meantime, a simple Excel macro is handling the sorting after exporting the tables…not what I want, but it works.

 

Regards,

 

King

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Jon K Peck
Sent: Tuesday, May 14, 2013 8:17 AM
To: [hidden email]
Subject: Re: CTABLES sort...force "Other" to bottom

 

You can, of course, dictate the order of the category list on the CTABLES CATEGORIES subcommand.  If you want a fixed order with Other as an exception and most of the category lists are the same, that would be the easiest thing to do.

However, if you want categories listed in ascending or descending count order, you can use the function genCategoryList in the spssaux2.py module from the SPSS Community site to build a set of macros that can be used in the CTABLES commands.  It takes an "exception" list for items such as Other that should be moved to the head or tail of the list.

So, the net is that you would run this function or something like it to generate the requisite macros and then use those in the CATEGORIES category list fields.  While this function sorts by counts, it would be simple to create one that sorted by values or value labels.

HTH,

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        King Douglas [hidden email]
To:        [hidden email],
Date:        05/14/2013 06:48 AM
Subject:        [SPSSX-L] CTABLES sort...force "Other" to bottom
Sent by:        "SPSSX(r) Discussion" [hidden email]





Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
 /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
 /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
 /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
   POSITION=AFTER.

* MR VARIABLE.


MRSETS
 /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
 /DISPLAY NAME=[$Flavor].

CTABLES
 /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
 /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
 /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
   POSITION=AFTER.

=====================
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: CTABLES sort...force "Other" to bottom

Bruce Weaver
Administrator
In reply to this post by King Douglas
King, please note that as a result of replying to a message from torstenh rather composing a new message from scratch, your CTABLES thread has become buried in the planned contrasts 2x2 repeated measure design in the Nabble archive (which increasing numbers of list members are using).  Therefore, anyone who is not paying attention to that thread will not see your message.  

Cheers,
Bruce


King Douglas wrote
Folks,

A search of the archives shows that this question has been addressed
previously without a satisfactory answer. I have many single and MR
variables with an "Other" category.  I want to create and sort tables in
ascending order of column percentages, but with "Other" at the bottom of the
table, irrespective of percentage.

I want to do this programmatically, with as little post-hoc work as
possible.  The tables will be exported to Excel and I can create a macro to
handle the sorting task, but I'd rather make this as clean as possible and
export the tables without further manipulation.  I wouldn't mind adding
variables to the dataset or to the table if that will get me where I want to
go.

So say we have two questions:

1. What's your favorite flavor of ice cream?
2. What ice cream flavors have you enjoyed in the last month?

In both cases, I want to sort the responses, but force "Other" to the bottom
of the table.  Any ideas?

Thanks,
King Douglas

* TESTED CODE FOLLOWS.

data list free
  /flavor1 to flavor4.
BEGIN DATA
1,2,3,4
2,3,4,1
3,4,1,2
4,1,2,3
1,3,2, 4
2,1,3,
4,1,2,
1,4,2,
END DATA.

VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
1 'Vanilla'
2 'Chocolate'
3 'Strawberry'
4 'Other'.

* SINGLE VARIABLE.

CTABLES
  /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
  /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
EMPTY=EXCLUDE TOTAL=YES
    POSITION=AFTER.

* MR VARIABLE.


MRSETS
  /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
  /DISPLAY NAME=[$Flavor].

CTABLES
  /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
  /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
  /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
EMPTY=INCLUDE TOTAL=YES
    POSITION=AFTER.

=====================
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: CTABLES sort...force "Other" to bottom

King Douglas
Ah, Bruce...good to know.  I'll not do that in the future.

Thanks,

King



From: Bruce Weaver <[hidden email]>
To: [hidden email]
Sent: Wed, May 15, 2013 7:55:09 AM
Subject: Re: CTABLES sort...force "Other" to bottom

King, please note that as a result of replying to a message from torstenh
rather composing a new message from scratch, your CTABLES thread has become
buried in the  planned contrasts 2x2 repeated measure design
<http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-td5720203.html>
in the Nabble archive (which increasing numbers of list members are using).
Therefore, anyone who is not paying attention to that thread will not see
your message.

Cheers,
Bruce



King Douglas wrote

> Folks,
>
> A search of the archives shows that this question has been addressed
> previously without a satisfactory answer. I have many single and MR
> variables with an "Other" category.  I want to create and sort tables in
> ascending order of column percentages, but with "Other" at the bottom of
> the
> table, irrespective of percentage.
>
> I want to do this programmatically, with as little post-hoc work as
> possible.  The tables will be exported to Excel and I can create a macro
> to
> handle the sorting task, but I'd rather make this as clean as possible and
> export the tables without further manipulation.  I wouldn't mind adding
> variables to the dataset or to the table if that will get me where I want
> to
> go.
>
> So say we have two questions:
>
> 1. What's your favorite flavor of ice cream?
> 2. What ice cream flavors have you enjoyed in the last month?
>
> In both cases, I want to sort the responses, but force "Other" to the
> bottom
> of the table.  Any ideas?
>
> Thanks,
> King Douglas
>
> * TESTED CODE FOLLOWS.
>
> data list free
>  /flavor1 to flavor4.
> BEGIN DATA
> 1,2,3,4
> 2,3,4,1
> 3,4,1,2
> 4,1,2,3
> 1,3,2, 4
> 2,1,3,
> 4,1,2,
> 1,4,2,
> END DATA.
>
> VALUE LABELS FLAVOR1 FLAVOR2 FLAVOR3 FLAVOR4
> 1 'Vanilla'
> 2 'Chocolate'
> 3 'Strawberry'
> 4 'Other'.
>
> * SINGLE VARIABLE.
>
> CTABLES
>  /VLABELS VARIABLES=flavor1 DISPLAY=DEFAULT
>  /TABLE flavor1 [COLPCT.COUNT PCT40.1, COUNT F40.0]
>  /CATEGORIES VARIABLES=flavor1 ORDER=A KEY=COLPCT.COUNT (flavor1)
> EMPTY=EXCLUDE TOTAL=YES
>    POSITION=AFTER.
>
> * MR VARIABLE.
>
>
> MRSETS
>  /MCGROUP NAME=$Flavor VARIABLES=flavor1 flavor2 flavor3 flavor4
>  /DISPLAY NAME=[$Flavor].
>
> CTABLES
>  /VLABELS VARIABLES=$Flavor DISPLAY=DEFAULT
>  /TABLE $Flavor [C][COLPCT.RESPONSES PCT40.1, COUNT F40.0]
>  /CATEGORIES VARIABLES=$Flavor ORDER=A KEY=COLPCT.RESPONSES ($Flavor)
> EMPTY=INCLUDE TOTAL=YES
>    POSITION=AFTER.
>
> =====================
> 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/planned-contrasts-2x2-repeated-measure-design-tp5720203p5720257.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: planned contrasts 2x2 repeated measure design

torstenh
In reply to this post by Ryan
Hi Ryan,
I ran your code (below). The last analysis (mixed y BY B A) results in an error (something like):

"The user-defined hypothesis test 1 (mean(B1A1)) is not executed, because the L-Matrix is not estimable." (I translated it from German, so it may not be exactly what one would get in English.)

This happens for all the user-defined tests.
(I couldn't find anything on the net regarding this specific error message - because I don't have the correct English error).
Torsten


-------
data list list / Subject B1A1 B1A2 B2A1 B2A2.
begin data
 1 9.2 7.5 6.4 7.3
 2 8.3 6.2 5.4 7.1
 3 8.6 7.2 4.4 8.4
 4 8.4 4.2 1.4 2.5
 5 8.9 6.2 1.1 2.3
end data.

VARSTOCASES
  /MAKE y FROM B1A1 B1A2 B2A1 B2A2
  /INDEX=B(2) A(2)
  /NULL=KEEP.

MIXED y BY B A
 /FIXED = B A B*A
 /REPEATED = A*B | SUBJECT(Subject) COVTYPE(UN)
 /PRINT SOLUTION
 /TEST 'mean(B1A1)' intercept 1 B 1 0 A 1 0 B*A 1 0 0 0
 /TEST 'mean(B1A2)' intercept 1 B 1 0 A 0 1 B*A 0 1 0 0
 /TEST 'mean(B2A1)' intercept 1 B 0 1 A 1 0 B*A 0 0 1 0
 /TEST 'mean(B2A2)' intercept 1 B 0 1 A 0 1 B*A 0 0 0 1
 /TEST 'mean(B1A1,B1A2)' intercept 2 B 2 0 A 1 1 B*A 1 1 0 0 DIVISOR=2
 /TEST 'mean(B2A1,B2A2)' intercept 2 B 0 2 A 1 1 B*A 0 0 1 1 DIVISOR=2
 /TEST '1st contrast: mean(B1A1,B1A2) MINUS mean(B2A1,B2A2)'  B 2 -2 B*A 1
1 -1 -1 DIVISOR=2
 /TEST 'mean(B1A1) MINUS mean(B1A2)' A 1 -1 B*A 1 -1 0 0
 /TEST '2nd contrast: mean (B2A1) MINUS mean(B2A2)' A 1 -1 B*A 0 0 1 -1
 /TEST 'diff of diff' B*A 1 -1 -1 1.
Reply | Threaded
Open this post in threaded view
|

Re: planned contrasts 2x2 repeated measure design

Ryan
There is nothing wrong with the code. I don't know what the correct technical word/phrase is but you need make sure that "begin data" is left indented without any spaces between begin and beginning of that line. Same goes with "end data". And, make sure that each TEST statement is on a single line. When I post code, it does not always come out EXACTLY as it needs to in order to run in SPSS. There may be extra spaces etc. that need to be cleaned up.
 
Ryan


On Thu, May 16, 2013 at 9:00 AM, torstenh <[hidden email]> wrote:
Hi Ryan,
I ran your code (below). The last analysis (mixed y BY B A) results in an
error (something like):

"The user-defined hypothesis test 1 (mean(B1A1)) is not executed, because
the L-Matrix is not estimable." (I translated it from German, so it may not
be exactly what one would get in English.)

This happens for all the user-defined tests.
(I couldn't find anything on the net regarding this specific error message -
because I don't have the correct English error).
Torsten


-------
data list list / Subject B1A1 B1A2 B2A1 B2A2.
begin data
 1 9.2 7.5 6.4 7.3
 2 8.3 6.2 5.4 7.1
 3 8.6 7.2 4.4 8.4
 4 8.4 4.2 1.4 2.5
 5 8.9 6.2 1.1 2.3
end data.

VARSTOCASES
  /MAKE y FROM B1A1 B1A2 B2A1 B2A2
  /INDEX=B(2) A(2)
  /NULL=KEEP.

MIXED y BY B A
 /FIXED = B A B*A
 /REPEATED = A*B | SUBJECT(Subject) COVTYPE(UN)
 /PRINT SOLUTION
 /TEST 'mean(B1A1)' intercept 1 B 1 0 A 1 0 B*A 1 0 0 0
 /TEST 'mean(B1A2)' intercept 1 B 1 0 A 0 1 B*A 0 1 0 0
 /TEST 'mean(B2A1)' intercept 1 B 0 1 A 1 0 B*A 0 0 1 0
 /TEST 'mean(B2A2)' intercept 1 B 0 1 A 0 1 B*A 0 0 0 1
 /TEST 'mean(B1A1,B1A2)' intercept 2 B 2 0 A 1 1 B*A 1 1 0 0 DIVISOR=2
 /TEST 'mean(B2A1,B2A2)' intercept 2 B 0 2 A 1 1 B*A 0 0 1 1 DIVISOR=2
 /TEST '1st contrast: mean(B1A1,B1A2) MINUS mean(B2A1,B2A2)'  B 2 -2 B*A 1
1 -1 -1 DIVISOR=2
 /TEST 'mean(B1A1) MINUS mean(B1A2)' A 1 -1 B*A 1 -1 0 0
 /TEST '2nd contrast: mean (B2A1) MINUS mean(B2A2)' A 1 -1 B*A 0 0 1 -1
 /TEST 'diff of diff' B*A 1 -1 -1 1.




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-tp5720203p5720278.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: planned contrasts 2x2 repeated measure design

torstenh
Thanks a lot Ryan,
It was an indentation problem.
I kind of figured out how to find the contrasts (with help from this http://www.ats.ucla.edu/stat/spss/faq/test_subcommand_mixed_mod.htm - maybe this will help someone else, too).

A1  A2  B1  B2

Now that leaves me with the problem that I want to test whether the second factor (1,2) affects B and does not affect A - and I could do that with this contrast (0 0 1 -1)
However this contrast neglects that in general A should have a higher value than B - and because this is the case, the contrast is not significant (?).

Is it possible to "pool out"(?) the main effect of the first factor (A, B) and then perform the (0 0 1 -1) contrast on the resulting values?

Ryan, I don't want to try your patience too far. Do you have any literature recommendation regarding these issues, so that I can figure this out myself.
Thanks,
Torsten
Reply | Threaded
Open this post in threaded view
|

Re: planned contrasts 2x2 repeated measure design

torstenh
Hi Ryan,
nevermind, my last post/question.

I just tried what I described and the (0 0 1 -1) contrast is the same for the original data and for the data in which the main effect of one of the factors is "pooled out" (if that is the correct expression). Thus, the analysis on the original data does that already (?) and it is not significant because the data is just not in that way. So, I have to live with that.

Still, do you have a recommendation for a book/article that summarizes these procedures?
Thanks,
Torsten
Reply | Threaded
Open this post in threaded view
|

Re: planned contrasts 2x2 repeated measure design

Ryan
In reply to this post by torstenh
Responses below:

Sent from my iPhone

On May 17, 2013, at 3:20 AM, torstenh <[hidden email]> wrote:

> Thanks a lot Ryan,
> It was an indentation problem.
> I kind of figured out how to find the contrasts (with help from this
> http://www.ats.ucla.edu/stat/spss/faq/test_subcommand_mixed_mod.htm
> <http://www.ats.ucla.edu/stat/spss/faq/test_subcommand_mixed_mod.htm>   -
> maybe this will help someone else, too).
>
> A1  A2  B1  B2
>
> Now that leaves me with the problem that I want to test whether the second
> factor (1,2) affects B and does not affect A

*That does not make any sense to me. Define "second factor."

> -
> and I could do that with this
> contrast (0 0 1 -1)

*I have no idea what term these coefficients are associated with. Write out the contrast, including the terms and coefficients [which should form an estimable function], as I did (see TEST statements).

> However this contrast

*What contrast?

> neglects that in general A should have a higher value
> than B - and because this is the case, the contrast is not significant (?).
>
> Is it possible to "pool out"(?) the main effect of the first factor (A, B)

*Why are you referring to factors A and B as a single factor?

> and then perform the (0 0 1 -1) contrast on the resulting values?

*Why do you continue to show these coefficients?

If you want to test whether there is an effect of A within each level of B, then I have already done this for you. If you want to determine whether there is an effect of B averaged over the levels of A, then I have already done this for you.

>
> Ryan, I don't want to try your patience too far. Do you have any literature
> recommendation regarding these issues, so that I can figure this out myself.

*Yes, any textbook that covers ANOVAs up through a two-way repeated measures ANOVA. The textbook should also explain planned contrasts. Perhaps take a course that covers these topics?

> Thanks,
> Torsten
>
>
>
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/planned-contrasts-2x2-repeated-measure-design-tp5720203p5720295.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