* Macro call . * Usage contour x1 x2 x3 x4 to xp . * Go to 1) and the Click Run and Then Run to End. *Read in your data set. * . *http://stat.tamu.edu/~mspeed/spss/general.html and look under Regression for Countour1 tutotial . *use the line below with your varaible names highlite the line and then hit the Play botton > above. CONTOUR testing voltg . *1). define contour (!POS !CMDEND). SAVE OUTFILE='temp_cont.sav' /COMPRESSED. !do !i !in (!1). !do !j !in (!1). !if (!i = !j) !then . !break. !ifend. matrix. get x /variables=!i !j / file ='temp_cont.sav' /Missing=Omit. * print x. compute nc =ncol(x). compute nr = nrow(x). * print nc. * print nr. compute j = make(nr,1,1). * print j. compute means = t(j)*x/nr. print means. compute a1 = kroneker(means,j). * print a1. compute a2 = x-a1. compute a3 = t(a2)*a2/(nr ). * print a3. compute eval1=make(nc,1,0). * print eval1. compute evect1 =make(nc,nc,0). * print evect1. call eigen(a3,evect1,eval1). * print eval1. * print evect1. * alpha = .05. * npts = number of points on contour. compute npts =300 . * print c. * print npts. compute t1 =({1:npts-1}-{1})*artan(1)*8/(npts-1). * print t1. compute c =-2*ln(.05). compute a = sqrt(c*eval1(1,1)). compute b = sqrt(c*eval1(2,1)). print a. print b. compute s1 = (sin(t1)) *a. compute s2 = (cos(t1))*b. compute s3={t(s1),t(s2)}. compute j = make(npts,1,1). * print j. compute nrows3 =nrow(s3). compute ncols3 = ncol(s3). * print nrows3. *print ncols3. compute a1 = kroneker(means,j). * print a1. compute s4 = s3*t(evect1) +a1. compute c =-2*ln(.1). compute a = sqrt(c*eval1(1,1)). compute b = sqrt(c*eval1(2,1)). * print a. * print b. compute s1 = (sin(t1)) *a. compute s2 = (cos(t1))*b. compute s3={t(s1),t(s2)}. compute j = make(npts,1,1). * print j. compute nrows3 =nrow(s3). compute ncols3 = ncol(s3). * print nrows3. *print ncols3. compute a1 = kroneker(means,j). * print a1. compute s4 = {s3*t(evect1) +a1,s4}. compute c =-2*ln(.5). compute a = sqrt(c*eval1(1,1)). compute b = sqrt(c*eval1(2,1)). * print a. * print b. compute s1 = (sin(t1)) *a. compute s2 = (cos(t1))*b. compute s3={t(s1),t(s2)}. compute j = make(npts,1,1). * print j. compute nrows3 =nrow(s3). compute ncols3 = ncol(s3). * print nrows3. *print ncols3. compute a1 = kroneker(means,j). * print a1. compute s4 = {s3*t(evect1) +a1,s4}. save s4 /outfile=*. end matrix. MATCH FILES /FILE=* /FILE='temp_cont.sav'. EXECUTE. variable labels col2 "50% P.I."/col1 " "/col4 "95% P.I."/col3 " "/col6 "99% P.I."/col5 " ". GRAPH /Title =' Prediction Intervals' /SCATTERPLOT(OVERLAY)=col2 col4 col6 !j WITH col1 col3 col5 !i (PAIR) /MISSING=VARIABLEWISE . !doend. !doend. !ENDDEFINE.