Different Chi-Square values in Friedman depending on using raw or rank values?

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

Different Chi-Square values in Friedman depending on using raw or rank values?

Matthias Spörrle
Hallo everybody,

does anyone has an idea why the Friedman Chi-Square values are not the same
(although quite similar) when using the ranks or the raw values of this data
file in Friedman rank ANOVA?

Thank you very much.

data sheet (first three columns represent raw values, second three ranked
values, N = 49, perhaps you have to replace comma):

DATA LIST LIST /v1 v2 v3 rv1 rv2 rv3.
BEGIN DATA
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    ,00    1,50    1,50    3,00
3,00    1,00    1,00    1,00    2,50    2,50
2,00    2,00    1,00    1,50    1,50    3,00
,00    ,00    ,00    2,00    2,00    2,00
2,00    2,00    1,00    1,50    1,50    3,00
1,00    ,00    1,00    1,50    3,00    1,50
2,00    1,00    1,00    1,00    2,50    2,50
,00    1,00    ,00    2,50    1,00    2,50
,00    1,00    1,00    3,00    1,50    1,50
3,00    3,00    1,00    1,50    1,50    3,00
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    1,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
2,00    2,00    1,00    1,50    1,50    3,00
2,00    3,00    ,00    2,00    1,00    3,00
2,00    1,00    1,00    1,00    2,50    2,50
1,00    2,00    2,00    3,00    1,50    1,50
1,00    1,00    ,00    1,50    1,50    3,00
3,00    2,00    2,00    1,00    2,50    2,50
2,00    1,00    2,00    1,50    3,00    1,50
3,00    3,00    2,00    1,50    1,50    3,00
2,00    2,00    1,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
3,00    ,00    1,00    1,00    3,00    2,00
3,00    2,00    2,00    1,00    2,50    2,50
3,00    3,00    2,00    1,50    1,50    3,00
2,00    2,00    2,00    2,00    2,00    2,00
2,00    1,00    2,00    1,50    3,00    1,50
3,00    3,00    1,00    1,50    1,50    3,00
2,00    2,00    1,00    1,50    1,50    3,00
2,00    2,00    ,00    1,50    1,50    3,00
2,00    3,00    3,00    1,00    2,50    2,50
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    3,00    2,00    2,00    2,00
2,00    2,00    2,00    2,00    2,00    2,00
2,00    3,00    2,00    2,50    1,00    2,50
2,00    3,00    1,00    2,00    1,00    3,00
3,00    3,00    2,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
3,00    2,00    2,00    1,00    2,50    2,50
2,00    2,00    1,00    1,50    1,50    3,00
1,00    2,00    2,00    3,00    1,50    1,50
2,00    1,00    1,00    1,00    2,50    2,50
1,00    3,00    2,00    3,00    1,00    2,00
1,00    2,00    2,00    3,00    1,50    1,50
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    2,00    1,50    1,50    3,00
2,00    3,00    ,00    2,00    1,00    3,00
END DATA.
LIST.

=====================
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: Different Chi-Square values in Friedman depending on using raw or rank values?

Marta Garcia-Granero
Matthias Spörrle escribió:
> does anyone has an idea why the Friedman Chi-Square values are not the same
> (although quite similar) when using the ranks or the raw values of this data
> file in Friedman rank ANOVA?
>

Because Friedman tests ranks data starting from lowest value, and rv1
rv2 and rv3 show ranks that start from highest value. Run the following
code and you will see the difference:

DATA LIST LIST /v1 v2 v3 rv1 rv2 rv3.
BEGIN DATA
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    ,00    1,50    1,50    3,00
3,00    1,00    1,00    1,00    2,50    2,50
2,00    2,00    1,00    1,50    1,50    3,00
,00    ,00    ,00    2,00    2,00    2,00
2,00    2,00    1,00    1,50    1,50    3,00
1,00    ,00    1,00    1,50    3,00    1,50
2,00    1,00    1,00    1,00    2,50    2,50
,00    1,00    ,00    2,50    1,00    2,50
,00    1,00    1,00    3,00    1,50    1,50
3,00    3,00    1,00    1,50    1,50    3,00
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    1,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
2,00    2,00    1,00    1,50    1,50    3,00
2,00    3,00    ,00    2,00    1,00    3,00
2,00    1,00    1,00    1,00    2,50    2,50
1,00    2,00    2,00    3,00    1,50    1,50
1,00    1,00    ,00    1,50    1,50    3,00
3,00    2,00    2,00    1,00    2,50    2,50
2,00    1,00    2,00    1,50    3,00    1,50
3,00    3,00    2,00    1,50    1,50    3,00
2,00    2,00    1,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
3,00    ,00    1,00    1,00    3,00    2,00
3,00    2,00    2,00    1,00    2,50    2,50
3,00    3,00    2,00    1,50    1,50    3,00
2,00    2,00    2,00    2,00    2,00    2,00
2,00    1,00    2,00    1,50    3,00    1,50
3,00    3,00    1,00    1,50    1,50    3,00
2,00    2,00    1,00    1,50    1,50    3,00
2,00    2,00    ,00    1,50    1,50    3,00
2,00    3,00    3,00    1,00    2,50    2,50
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    3,00    2,00    2,00    2,00
2,00    2,00    2,00    2,00    2,00    2,00
2,00    3,00    2,00    2,50    1,00    2,50
2,00    3,00    1,00    2,00    1,00    3,00
3,00    3,00    2,00    1,50    1,50    3,00
3,00    2,00    1,00    1,00    2,00    3,00
3,00    2,00    2,00    1,00    2,50    2,50
2,00    2,00    1,00    1,50    1,50    3,00
1,00    2,00    2,00    3,00    1,50    1,50
2,00    1,00    1,00    1,00    2,50    2,50
1,00    3,00    2,00    3,00    1,00    2,00
1,00    2,00    2,00    3,00    1,50    1,50
3,00    3,00    3,00    2,00    2,00    2,00
3,00    3,00    2,00    1,50    1,50    3,00
2,00    3,00    ,00    2,00    1,00    3,00
END DATA.

DATASET NAME Data.
DATASET DECLARE RankedData WINDOW=MINIMIZED.

* Rank data and add new columns to dataset *.
TEMPORARY.
SET MXLOOPS=100.
MATRIX.
GET rawdata /VAR=v1 v2 v3 /NAME=gnames /MISSING=OMIT.
COMPUTE b=NROW(rawdata).
COMPUTE k=NCOL(rawdata).
COMPUTE rdata=MAKE(b,k,0).
LOOP i=1 TO b.
- COMPUTE rdata(i,:)=RNKORDER(rawdata(i,:)).
END LOOP.
SAVE rdata /OUTFILE='RankedData'.
END MATRIX.

MATCH FILES /FILE=*
 /FILE='RankedData'.
DATASET CLOSE RankedData.
FORMAT rv1 TO col3 (F8.1).
LIST.

* Friedman test with raw and ranked data *.
NPAR TESTS
  /FRIEDMAN = v1 TO v3
  /FRIEDMAN = col1 TO col3.


Regards,
Marta

--
For miscellaneous statistical stuff, visit:
http://gjyp.nl/marta/

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