1! Program GEN8A.BAS Version 1 June, 1976 This is the data generator for Unit 8A: Analysis of Covariance, Symmetry 2! Department of Psychology Lawrence University Appleton, Wisconsin, 54911 (414) 739-3681, Ext. 464 3! Copyright (C) 1975, 1976 by Francis Campos. General permission to copy or modify, but not for profit, all or part of this document or the software described herein is hereby 4! granted, provided that this copyright notice is given, and reference is made to the fact that reproduction privileges were granted by permission of Francis Campos, Lawrence University. 5! Although every effort has been made to insure the accuracy and usefulness of this document and the software described herein, neither the author(s), Lawrence University, nor its funding 6! sources make any warranty, expressed or implied, with respect to the performance or features of same on equipment which Lawrence neither owns nor controls. 7! This program is one of the twenty-one BASIC-PLUS programs and eighteen virtual core files that comprise the CASANOVA package for Computer ASsisted instruction in ANalysis Of 8! VAriance. The package is coded for use on a PDP 11/40, 45 or 70 computer operating under RSTS/E, V6A-02. Those who wish to adapt the package to other systems and/or programming languages are 9! urged to consult the BASIC-PLUS Language Manual, published by the Digital Equipment Corporation, Maynard, Massachusetts, 01754, as well as the Instructor's Manual for CASANOVA, provided by Lawrence. 105 RANDOMIZE 110 N=4:A=3 115 &:INPUT"WHAT IS YOUR NAME";Z1$ 120 Z1$=Z1$+".XDS" 125 OPEN Z1$ AS FILE 1 130 Q=16 135 DIM#1, A2(16),A2$(2) 140 DIM A(16),X(4,3),Y(4,3),C(4,3),T(3),X1(3),Y1(3) 145 A2(0)=16:A2$(1)="8A" 150 A2$(0)="" 155 GOTO 500 160 A2(I)=A(I) FOR I=1 TO Q 165 CLOSE 1 170 CHAIN "INTXSM" 500 B=-.4: T(1)=.3: T(2)=.4: T(3)=.5 510 FOR I=1 TO N:FOR J=1 TO A 520 X(I,J)=INT(RND*5)+7 525 Y=0 530 FOR L=1 TO 20 540 IF RND>T(J) THEN 560 550 Y=Y+1 560 NEXT L 570 Y(I,J)=INT(Y+(X*B)) 580 X1(J)=X1(J)+X(I,J) 590 Y1(J)=Y1(J)+Y(I,J) 600 X9=X9+X(I,J) 610 Y9=Y9+Y(I,J) 620 X2=X2+X(I,J)^2 630 Y2=Y2+Y(I,J)^2 640 Z2=Z2+(X(I,J)*Y(I,J)) 650 NEXT J:NEXT I 660 A(1)=Y9^2/A/N 670 A(2)=Y2-A(1) 680 X=0 690 X=X+Y1(J)^2 FOR J=1 TO A 700 A(3)=X/N-A(1) 710 A(4)=A(2)-A(3) 720 A(5)=X9^2/A/N 730 A(6)=X2-A(5) 735 X=0 740 X=X+X1(J)^2 FOR J=1 TO A 750 A(7)=X/N-A(5) 760 A(8)=A(6)-A(7) 770 A(9)=Y9*X9/A/N 775 X=0 780 FOR I=1 TO N:FOR J=1 TO A 790 X=X+X(I,J)*Y(I,J):NEXT J:NEXT I 800 A(10)=X-A(9) 805 X=0 810 X=X+Y1(J)*X1(J) FOR J=1 TO A 820 A(11)=X/N-A(9) 830 A(12)=A(10)-A(11) 840 A(13)=A(2)-(A(10)^2/A(6)) 845 IF A(13)<0 THEN 2000 850 A(14)=A(4)-(A(12)^2/A(8)) 855 IF A(14)<0 THEN 2000 860 A(15)=A(13)-A(14) 865 IF A(15)<0 THEN 2000 870 A(16)=(A(15)/(A-1))/(A(14)/(A*(N-1)-1)) 875 & 880 &"ANALYSIS OF COVARIANCE" 882 &"THESE ARE THE DATA FOR THIS ANALYSIS. THE CROSS PRODUCTS 884 &"ARE PROVIDED TO SAVE YOU COMPUTATION.":& 900 &"NUMBER OF ERRORS","VARIATE Y(I,J)":& 910 &,,"A1","A2","A3" 920 &,,Y(I,1),Y(I,2),Y(I,3) FOR I=1 TO 4 930 &:&"AGE IN YEARS",,"COVARIATE X(I,J)" 940 &:&,,"A1","A2","A3" 950 &,,X(I,1),X(I,2),X(I,3) FOR I=1 TO 4 970 FOR I=1 TO 4: FOR J=1 TO 3 980 C(I,J)=X(I,J)*Y(I,J) 990 NEXT J:NEXT I 1000 &:&,,"CROSS PRODUCTS X(I,J)Y(I,J)":& 1010 &,,"A1","A2","A3" 1020 &,,C(I,1),C(I,2),C(I,3) FOR I=1 TO 4 1030 GOTO 160 2000 !ELIMINATES NEGATIVE SS'S 2010 MAT X1=ZER 2020 MAT Y1=ZER 2030 X9,Y9,X2,Y2,Z2=0 2040 GOTO 500 9998 GOTO 160 9999 END