1! Program GEN4A.BAS Version 1 June, 1976 This is the data generator for Unit 4A: Three-way ANOVA, Agression 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=5 !A=B=C=2 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),D(5,8),S(8),A4(2,2),B(2,2),C(2,2),A1(2),B1(2),C1(2),P(8) 145 A2(0)=16: A2$(1)="4A" 150 A2$(0)="" 155 GOTO 500 160 A2(I)=A(I) FOR I=1 TO Q 165 CLOSE 1 170 CHAIN "INTXSM" 500 READ P(I) FOR I=1 TO 8 510 DATA 2.1,4.2,3,3,3.4,1.7,3.1,1.7 520 FOR I=1 TO N: FOR J=1 TO 2: FOR K=1 TO 2: FOR L=1 TO 2 530 D=0 540 D=D+RND FOR M=1 TO 12 545 D=(D-6)*2 550 D=INT(D+P(4*(J-1)+2*(K-1)+L)) 552 IF D<1 OR D>7 THEN 530 555 D(I,4*(J-1)+2*(K-1)+L)=D 560 NEXT L:NEXT K:NEXT J:NEXT I 570 FOR I=1 TO N:FOR J=1 TO 8 580 S(J)=S(J)+D(I,J):T=T+D(I,J):T2=T2+D(I,J)^2 585 NEXT J:NEXT I 590 FOR J=1 TO 2:FOR K=1 TO 2:FOR L=1 TO 2 600 D=S(4*(J-1)+2*(K-1)+L) 610 A4(J,K)=A4(J,K)+D 620 B(J,L)=B(J,L)+D 630 C(K,L)=C(K,L)+D 640 A1(J)=A1(J)+D 650 B1(K)=B1(K)+D 660 C1(L)=C1(L)+D 670 NEXT L:NEXT K:NEXT J 680 A(1)=T^2/40 690 A(2)=((A1(1)^2+A1(2)^2)/20)-A(1) 700 A(3)=((B1(1)^2+B1(2)^2)/20)-A(1) 710 A(4)=((C1(1)^2+C1(2)^2)/20)-A(1) 720 A(5)=((A4(1,1)^2+A4(1,2)^2+A4(2,1)^2+A4(2,2)^2)/10)-A(1)-A(2)-A(3) 730 A(6)=((B(1,1)^2+B(1,2)^2+B(2,1)^2+B(2,2)^2)/10)-A(1)-A(2)-A(4) 740 A(7)=((C(1,1)^2+C(1,2)^2+C(2,1)^2+C(2,2)^2)/10)-A(1)-A(3)-A(4) 745 T=0 750 T=T+S(J)^2 FOR J=1 TO 8 760 A(8)=T/5-A(1)-A(2)-A(3)-A(4)-A(5)-A(6)-A(7) 770 A(9)=T2-(T/5) 780 E=A(9)/32 790 A(10)=A(2)/E 800 A(11)=A(3)/E 810 A(12)=A(4)/E 820 A(13)=A(5)/E 830 A(14)=A(6)/E 840 A(15)=A(7)/E 850 A(16)=A(8)/E 1000 PRINT: PRINT,"AGGRESSION DATA" 1010 PRINT 1020 PRINT," A1 B1",," A1 B2" 1030 PRINT,"C1","C2","C1","C2" 1035 FOR I=1 TO N 1040 PRINT,D(I,1),D(I,2),D(I,3),D(I,4) 1045 NEXT I 1050 PRINT: PRINT," A2 B1",," A2 B2" 1060 PRINT,"C1","C2","C1","C2" 1065 FOR I=1 TO N 1070 PRINT,D(I,5),D(I,6),D(I,7),D(I,8) 1075 NEXT I 1080 PRINT 9998 GOTO 160 9999 END