Diff for "FAQ/WilliamsSPSS" - CBU statistics Wiki
location: Diff for "FAQ/WilliamsSPSS"
Differences between revisions 5 and 9 (spanning 4 versions)
Revision 5 as of 2006-07-11 15:08:14
Size: 2090
Editor: pc0082
Comment:
Revision 9 as of 2006-07-11 15:13:43
Size: 2101
Editor: pc0082
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
* Dependent Correlation Comparison Program.  * Compares correlation coefficients from the same sample.
* See Cohen & Cohen (1983), p. 57.  * Sam Field, sfield@mail.la.utexas.edu, March 1, 2000.  
'* Dependent Correlation Comparison Program.'
'* Compares correlation coefficients from the same sample.'
'
* See Cohen & Cohen (1983), p. 57.'
'
* Sam Field, sfield@mail.la.utexas.edu, March 1, 2000.'
' '
Line 18: Line 18:
 set format f10.5.
 DATA LIST free
 /r12 r13 r23 nsize.
 BEGIN DATA
 .50 .32 .65 50
 .59 .31 .71 30
 .80 .72 .89 26
 END DATA.
set format f10.5.
Line 27: Line 20:
 ***************macro and macro call**************
 **** tests if rxy=rvy and outputs a t-statistic plus one and two-tailed p-values
DATA LIST free
Line 30: Line 22:
 define williams (rxy = !tokens(1)
                      /rvy = !tokens(1)
                      /rxv = !tokens(1)
                      /n = !tokens(1)).
/r12 r13 r23 nsize.
Line 35: Line 24:
 COMPUTE #diffr = !rxy - !rvy. BEGIN DATA
Line 37: Line 26:
 COMPUTE #detR = (1 - !rxy **2 - !rvy**2 - !rxv**2)+ (2*!rxy*!rxv*!rvy).
 *Calculate (rxy + rvy)^2 .
 COMPUTE #rbar = (!rxy + !rvy)/2.
.50 .32 .65 50
Line 41: Line 28:
 * Calculate numerator of t statistic.
 COMPUTE #tnum = (#diffr) * (sqrt((!n-1)*(1 + !rxv))).
.59 .31 .71 30
Line 44: Line 30:
 COMPUTE #tden = sqrt(2*((!n-1)/(!n-3))*#detR + ((#rbar**2) * ((1-!rxv)**3))). .80 .72 .89 26
Line 46: Line 32:
 COMPUTE t= (#tnum/#tden).
 COMPUTE df = !n - 3.
END DATA.
Line 49: Line 34:
 * Evaluate the value of the t statistic.
 * against a t distribution with n - 3 degrees if freedom for.
 * statistical significance.
 COMPUTE p_1_tail = 1 - CDF.T(abs(t),df).
 COMPUTE p_2_tail = (1 - CDF.T(abs(t),df))*2.
***************macro and macro call**************
Line 55: Line 36:
 * Print the results.
 LIST t df p_1_tail p_2_tail.
 exe.
 !enddefine.
**** tests if rxy=rvy and outputs a t-statistic plus one and two-tailed p-values
Line 60: Line 38:
 ********************* define williams (rxy = !tokens(1)
Line 62: Line 40:
 williams rxy=r12 rvy=r13 rxv=r23 n=nsize.                    /rvy = !tokens(1)

                   /rxv = !tokens(1)

                   /n = !tokens(1)).

COMPUTE #diffr = !rxy - !rvy.

COMPUTE #detR = (1 - !rxy **2 - !rvy**2 - !rxv**2)+ (2*!rxy*!rxv*!rvy).

*Calculate (rxy + rvy)^2 .

COMPUTE #rbar = (!rxy + !rvy)/2.

* Calculate numerator of t statistic.
COMPUTE #tnum = (#diffr) * (sqrt((!n-1)*(1 + !rxv))).

COMPUTE #tden = sqrt(2*((!n-1)/(!n-3))*#detR + ((#rbar**2) * ((1-!rxv)**3))).

COMPUTE t= (#tnum/#tden).
COMPUTE df = !n - 3.

* Evaluate the value of the t statistic.

* against a t distribution with n - 3 degrees if freedom for.

* statistical significance.

COMPUTE p_1_tail = 1 - CDF.T(abs(t),df).
COMPUTE p_2_tail = (1 - CDF.T(abs(t),df))*2.

* Print the results.

LIST t df p_1_tail p_2_tail.
 
exe.
 
!enddefine.

*********************

williams rxy=r12 rvy=r13 rxv=r23 n=nsize.

A variable in common (overlap) e.g. of form r(W,X) = r(W,Z).

A test for this comparison goes under various names the Williams test, Williams-Hotelling or Hotelling test.

An example of its use together with syntax is given below. Just cut and paste into a SPSS syntax window to use. You can also use the Williams-Hotelling test by typing equalcor at a UNIX prompt on a CBU machine.

'* Dependent Correlation Comparison Program.' '* Compares correlation coefficients from the same sample.' '* See Cohen & Cohen (1983), p. 57.' '* Sam Field, sfield@mail.la.utexas.edu, March 1, 2000.' ' ' ******** this input is inputted in the macro call at end of this syntax********* * Three pairs of correlations to compare*****

set format f10.5.

DATA LIST free

/r12 r13 r23 nsize.

BEGIN DATA

.50 .32 .65 50

.59 .31 .71 30

.80 .72 .89 26

END DATA.

***************macro and macro call**************

**** tests if rxy=rvy and outputs a t-statistic plus one and two-tailed p-values

define williams (rxy = !tokens(1)

  • /rvy = !tokens(1) /rxv = !tokens(1) /n = !tokens(1)).

COMPUTE #diffr = !rxy - !rvy.

COMPUTE #detR = (1 - !rxy **2 - !rvy**2 - !rxv**2)+ (2*!rxy*!rxv*!rvy).

*Calculate (rxy + rvy)^2 .

COMPUTE #rbar = (!rxy + !rvy)/2.

* Calculate numerator of t statistic. COMPUTE #tnum = (#diffr) * (sqrt((!n-1)*(1 + !rxv))).

COMPUTE #tden = sqrt(2*((!n-1)/(!n-3))*#detR + ((#rbar**2) * ((1-!rxv)**3))).

COMPUTE t= (#tnum/#tden). COMPUTE df = !n - 3.

* Evaluate the value of the t statistic.

* against a t distribution with n - 3 degrees if freedom for.

* statistical significance.

COMPUTE p_1_tail = 1 - CDF.T(abs(t),df). COMPUTE p_2_tail = (1 - CDF.T(abs(t),df))*2.

* Print the results.

LIST t df p_1_tail p_2_tail.

exe.

!enddefine.

*********************

williams rxy=r12 rvy=r13 rxv=r23 n=nsize.

None: FAQ/WilliamsSPSS (last edited 2021-04-09 11:33:29 by PeterWatson)