# Program for Corresponding Regressions

BillJanie@aol.com
Tue, 12 Mar 1996 21:45:02 -0500

--PART.BOUNDARY.0.29563.emout07.mail.aol.com.826685100
Content-ID: <0_29563_826685100@emout07.mail.aol.com.201358>
Content-type: text/plain

Attach file.

--PART.BOUNDARY.0.29563.emout07.mail.aol.com.826685100
Content-ID: <0_29563_826685100@emout07.mail.aol.com.201359>
Content-type: text/plain;
name="GRAIL22"
Content-Transfer-Encoding: quoted-printable

Lois,
=0D
The following are the matrix procedures for
calculating corresponding regressions. =

The program was written in the GAUSS
matrix language and should be easily
translated into other languages. In the
program each of the columns of x are
compared with one another. Each
comparison lets each of the variables
stand as the hypothetical dv and iv in
turn. rde correlations are calculated and
subtracted to obtain the D statistic.
When D is significantly negative, the
variable printed on the left is the IV.
=0D
The data included in the program
is the mandala grid. All of the D's for
this data are zero, indicating no formal
cause relationships. That is, the
variables of the mandala matrix are
coordinates- not subordinates, nor
superordinates of one another. =

=0D

Gauss Program for Corresponding
Regressions on Grids
=0D
format /m1/ros 8,2;
/* The mandala grid */
let x[8,8]=3D 1 2 3 4 5 6 7 8
2 1 4 3 6 5 8 7
3 4 1 2 7 8 5 6
4 3 2 1 8 7 6 5
5 6 7 8 1 2 3 4
6 5 8 7 2 1 4 3
7 8 5 6 3 4 1 2
8 7 6 5 4 3 2 1;
=0D
mean=3Dmeanc(x); /* means of x */
dev=3Dx-mean'; /* deviations*/
std=3Dstdc(x); /* std of x */
z=3Ddev./std'; /* z scores */
print "means" mean'; /* print means */
"standard deviations" std';/* print std */
rx=3Dcorrx(x); /* correlations of x */
print "Correlations" rx;
n=3Drows(x); /* number rows in x */
k=3Dcols(x); /* number columns in x */
i=3D1; /* looping counter */
" The left hand variable is treated as the predictor of the right";
"If D is strongly negative, the left hand var. is inferred to be the IV."=
;
let head=3Drow col D xty->erx xtx->ery;
/* xty->erx=3D corr between extremes of y and errors in x */
/*xtx_>ery=3D corr between extremes of x and errors in y */
/*d=3D(xty->erx)-(xtx->ery) */
do while i<=3Dk; /* increments the iv loop**/
j=3D1;
iv=3Dsubmat(z,0,i); /* submatrix from z */
/* hypothesized iv*/
j=3D1;
do while j<=3Dk; /* loop sets the dv value ****/
dv=3Dsubmat(z,0,j);
pp=3Dabs(i-j);
if pp>0;
/**** regresses, x and y and finds the d */
xx=3Div~dv; /* matrix of hypo.iv and dv */
coor1=3Dcorrx(xx); /* xx correlations */
b=3Dsubmat(coor1,1,2); /* b as r for hypo iv & dv */
dvp1=3Div.*b; /*X predicts y. */
dvp2=3Ddv.*b; /*y predicts x*/
err1=3Ddv-dvp1; /*errors predicting y */
err2=3Div-dvp2; /* errors predicting x*/
aberr1=3Dabs(err1); /*abs. errors predicting y */
aberr2=3Dabs(err2); /*abs. errors predicting x */
dev1=3Div-(meanc(iv)); /*dev.of x */
dev2=3Ddv-(meanc(dv)); /*dev.of y */
absdev1=3Dabs(dev1); /*extremity of x */
absdev2=3Dabs(dev2); /*extremity of y */
pair1=3Daberr1~absdev1; /* abs errors pred. y & extr. of x */
pair2=3Daberr2~absdev2; /* abs errors pred. x & extr. of y */
rcc1=3Dcorrx(pair1); /* corr. pair 1 */
rcc2=3Dcorrx(pair2); /* corr. pair 2 */
cxy=3Dsubmat(rcc1,1,2); /* corr. extr. and error when x is predic=
tor */
cyx=3Dsubmat(rcc2,1,2); /*corr. extr. and error when y is predict=
or */
d=3Dcyx-cxy; /* D--- you expect cyx to be more negativ=
e */
print i~j~d~cyx~cxy; /*concatenates data */
j=3Dj+1; /* increment loop */
else;
j=3Dj+1;
endif;
endo; /* End dv loop **/
i=3Di+1;
endo; /* End iv loop */
=0D

Bill Chambers
=0D

--PART.BOUNDARY.0.29563.emout07.mail.aol.com.826685100--

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%