Repeated Measures Chi Squared

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

Repeated Measures Chi Squared

Allen Cornelius-2
I have confused myself. A student has presented me with a research dilemma.
Here is the issue. Subjects were asked to categorize their relationship
style as S, F, P, or D at some time in the past, and then again for current
day. He is interested in any changes that occurred. So the data is
categorical, and it is repeated measures. I first thought a chi squared test
of independence with the four categories at each time, but the repeated
measures aspect seemed to violate the independent observations assumption of
chi squared. So I investigated other options, but could not find a suitable
solution. Then I wondered again about whether the assumption was actually
violated, as each person really is only in one cell and the observations are
independent. I am confused. So I could use another thought on this. I will
try to diagram the analysis below:

                           Current day
                   S     F     P     D
In the past
              S    20    15    8     7

              F     5     7    6     10

              P     6     4    19     9

              D     4     17   6      7
(the data is made up - I don't have the actual numbers in front of me).

So, given that the same person was asked about which category they fall into
in the past and current day, does this violate the assumptions of chi
squared? Is there another way to analyze this change in status?

Thanks for any wisdom.

=====================
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: Repeated Measures Chi Squared

bdates
Allen,

You may want to check out the McNemar test for two measures of one group or Cochran's Q for more than two measures of one group.

Brian

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Allen Cornelius
Sent: Friday, May 17, 2013 1:27 PM
To: [hidden email]
Subject: Repeated Measures Chi Squared

I have confused myself. A student has presented me with a research dilemma.
Here is the issue. Subjects were asked to categorize their relationship
style as S, F, P, or D at some time in the past, and then again for current
day. He is interested in any changes that occurred. So the data is
categorical, and it is repeated measures. I first thought a chi squared test
of independence with the four categories at each time, but the repeated
measures aspect seemed to violate the independent observations assumption of
chi squared. So I investigated other options, but could not find a suitable
solution. Then I wondered again about whether the assumption was actually
violated, as each person really is only in one cell and the observations are
independent. I am confused. So I could use another thought on this. I will
try to diagram the analysis below:

                           Current day
                   S     F     P     D
In the past
              S    20    15    8     7

              F     5     7    6     10

              P     6     4    19     9

              D     4     17   6      7
(the data is made up - I don't have the actual numbers in front of me).

So, given that the same person was asked about which category they fall into
in the past and current day, does this violate the assumptions of chi
squared? Is there another way to analyze this change in status?

Thanks for any wisdom.

=====================
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: Repeated Measures Chi Squared

Bruce Weaver
Administrator
Further to Brian's suggestion about the McNemar chi-square, see this:

  http://www-01.ibm.com/support/docview.wss?uid=swg21477019


bdates wrote
Allen,

You may want to check out the McNemar test for two measures of one group or Cochran's Q for more than two measures of one group.

Brian

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Allen Cornelius
Sent: Friday, May 17, 2013 1:27 PM
To: [hidden email]
Subject: Repeated Measures Chi Squared

I have confused myself. A student has presented me with a research dilemma.
Here is the issue. Subjects were asked to categorize their relationship
style as S, F, P, or D at some time in the past, and then again for current
day. He is interested in any changes that occurred. So the data is
categorical, and it is repeated measures. I first thought a chi squared test
of independence with the four categories at each time, but the repeated
measures aspect seemed to violate the independent observations assumption of
chi squared. So I investigated other options, but could not find a suitable
solution. Then I wondered again about whether the assumption was actually
violated, as each person really is only in one cell and the observations are
independent. I am confused. So I could use another thought on this. I will
try to diagram the analysis below:

                           Current day
                   S     F     P     D
In the past
              S    20    15    8     7

              F     5     7    6     10

              P     6     4    19     9

              D     4     17   6      7
(the data is made up - I don't have the actual numbers in front of me).

So, given that the same person was asked about which category they fall into
in the past and current day, does this violate the assumptions of chi
squared? Is there another way to analyze this change in status?

Thanks for any wisdom.

=====================
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: Repeated Measures Chi Squared

Ray Koopman
In reply to this post by Allen Cornelius-2
You need each person's data to be independent of every other person's data. Whether the past and current observations are independent is a possible experimental question.

It's not clear just what the question is. If it's whether there is a relation between the past and current data then the usual chi-square test of independence would be appropriate. If it's whether the past and current marginal distributions differ then you want Stuart's test of marginal homogeneity. (Don't use Bhapkar's test. It involves the diagonals of the table, which are logically irrelevant.)
Reply | Threaded
Open this post in threaded view
|

Re: Repeated Measures Chi Squared

Ryan

Ray and others,


Since I had never heard of Stuart's test of Marginal Homogeneity (or at least I can't remember), I decided to search for it online. Upon my travels, I noticed that some people refer to the test as the Stuart-Maxwell's Test of Marginal Homogeneity.


I found the notation provided on the website below to be helpful:


http://www.mathworks.com/matlabcentral/fileexchange/6367-stumaxtest/content/StuMaxtest.m


Next, I located an actual example (where K=3) about halfway down the page here:


http://www.john-uebersax.com/stat/mcnemar.htm


I was able to replicate the results from that example using the SPSS syntax below my name.


If someone believes I've made an error, please do write back to the list. Clearly, someone with the proper expertise in SPSS programming could create code to handle any size table. Perhaps it already exists out there? Perhaps SPSS offers this test already, thereby rendering the syntax unnecessary? I do not know. Regardless, this was an interesting exercise.


Best,


Ryan


--


matrix.
compute n11=20.
compute n12=10.
compute n13=5.
compute n21=3.
compute n22=30.
compute n23=15.
compute n31=0.
compute n32=5.
compute n33=40.
compute K={n11, n12, n13; n21, n22, n23; n31, n32, n33}.
compute d={((n11+n12+n13)-(n11+n21+n31));
                   ((n21+n22+n23)-(n12+n22+n32))}.
compute S={((n11+n12+n13)+(n11+n21+n31)-2*(n11)),(-(n12+n21));
                    (-(n12+n21)),((n21+n22+n23)+(n12+n22+n32)-2*(n22))}.
compute Chi_Sqr=T(d)*INV(S)*d.
print K /title "K".
print d /title "d".
print S /title "S".
print Chi_sqr /title "Chi-Square".
end matrix.
execute.

 

compute p_value=1-CDF.CHISQ(13.76470588,2).
execute.



On Fri, May 17, 2013 at 2:30 PM, Ray Koopman <[hidden email]> wrote:
You need each person's data to be independent of every other person's data.
Whether the past and current observations are independent is a possible
experimental question.

It's not clear just what the question is. If it's whether there is a
relation between the past and current data then the usual chi-square test of
independence would be appropriate. If it's whether the past and current
marginal distributions differ then you want Stuart's test of marginal
homogeneity. (Don't use Bhapkar's test. It involves the diagonals of the
table, which are logically irrelevant.)



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Repeated-Measures-Chi-Squared-tp5720309p5720312.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: Repeated Measures Chi Squared

Kornbrot, Diana
Re: Repeated Measures Chi Squared A simple and exact approach is to count the frequency above the diagonalm Nabove and the frequnecy below the diagonal , Nbelow and then do an EXACT binomial test of Nabove/(Nabove+Nbelow) = .5.this is equivalent in approach to the McNemar. [no change items are on diagona, and ignoredl]
The test can be EXACT if frequencies are high, or use exact binomial distribution if frequencies are low.
Best

Diana


On 18/05/2013 02:20, "Ryan Black" <ryan.andrew.black@...> wrote:

Ray and others,


Since I had never heard of Stuart's test of Marginal Homogeneity (or at least I can't remember), I decided to search for it online. Upon my travels, I noticed that some people refer to the test as the Stuart-Maxwell's Test of Marginal Homogeneity.


I found the notation provided on the website below to be helpful:


http://www.mathworks.com/matlabcentral/fileexchange/6367-stumaxtest/content/StuMaxtest.m


Next, I located an actual example (where K=3) about halfway down the page here:


http://www.john-uebersax.com/stat/mcnemar.htm


I was able to replicate the results from that example using the SPSS syntax below my name.


If someone believes I've made an error, please do write back to the list. Clearly, someone with the proper expertise in SPSS programming could create code to handle any size table. Perhaps it already exists out there? Perhaps SPSS offers this test already, thereby rendering the syntax unnecessary? I do not know. Regardless, this was an interesting exercise.


Best,


Ryan


--


matrix.
compute n11=20.
compute n12=10.
compute n13=5.
compute n21=3.
compute n22=30.
compute n23=15.
compute n31=0.
compute n32=5.
compute n33=40.
compute K={n11, n12, n13; n21, n22, n23; n31, n32, n33}.
compute d={((n11+n12+n13)-(n11+n21+n31));
                   ((n21+n22+n23)-(n12+n22+n32))}.
compute S={((n11+n12+n13)+(n11+n21+n31)-2*(n11)),(-(n12+n21));
                    (-(n12+n21)),((n21+n22+n23)+(n12+n22+n32)-2*(n22))}.
compute Chi_Sqr=T(d)*INV(S)*d.
print K /title "K".
print d /title "d".
print S /title "S".
print Chi_sqr /title "Chi-Square".
end matrix.
execute.

 

compute p_value=1-CDF.CHISQ(13.76470588,2).
execute.



On Fri, May 17, 2013 at 2:30 PM, Ray Koopman <koopman@...> wrote:
You need each person's data to be independent of every other person's data.
Whether the past and current observations are independent is a possible
experimental question.

It's not clear just what the question is. If it's whether there is a
relation between the past and current data then the usual chi-square test of
independence would be appropriate. If it's whether the past and current
marginal distributions differ then you want Stuart's test of marginal
homogeneity. (Don't use Bhapkar's test. It involves the diagonals of the
table, which are logically irrelevant.)



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Repeated-Measures-Chi-Squared-tp5720309p5720312.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD




Emeritus Professor Diana Kornbrot
email:  d.e.kornbrot@...    
 web:    http://dianakornbrot.wordpress.com/
Work
Department of Psychology
School of Life and Medical Sciences
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
Home
19 Elmhurst Avenue
London N2 0LT, UK
voice:   +44 (0) 208  444 2081
mobile: +44 (0) 740 318 1612


Reply | Threaded
Open this post in threaded view
|

FW: Repeated Measures Chi Squared

Anthony Babinec
Re: Repeated Measures Chi Squared

From SPSS Crosstabs Statistics Help

 

McNemar. A nonparametric test for two related dichotomous variables. Tests for changes in responses using the chi-square distribution. Useful for detecting changes in responses due to experimental intervention in "before-and-after" designs. For larger square tables, the McNemar-Bowker test of symmetry is reported.

 

The Exact Tests option in theory offers monte carlo and exact p-values, although I see no

change to the Crosstabs output when I run this test in IBM SPSS Statistics 21.

 

Tony Babinec

[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Repeated Measures Chi Squared

Swank, Paul R
The McNemar test is for symmetry  or homogeneity of marginal proportions, which are the same thing in a 2 x 2 table. For larger tables, they are different so use the Bowker test for symmetry of a Kxk table and the Stuart-Maxwell test for homogenity of the marginal proportions.

Paul R. Swank, Ph.D., Professor
Health Promotions and Behavioral Sciences
School of Public Health
University of Texas Health Science Center Houston

________________________________
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Anthony Babinec [[hidden email]]
Sent: Saturday, May 18, 2013 10:04 AM
To: [hidden email]
Subject: FW: Repeated Measures Chi Squared

From SPSS Crosstabs Statistics Help

McNemar. A nonparametric test for two related dichotomous variables. Tests for changes in responses using the chi-square distribution. Useful for detecting changes in responses due to experimental intervention in "before-and-after" designs. For larger square tables, the McNemar-Bowker test of symmetry is reported.

The Exact Tests option in theory offers monte carlo and exact p-values, although I see no
change to the Crosstabs output when I run this test in IBM SPSS Statistics 21.

Tony Babinec
[hidden email]<mailto:[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