program chi(input, output); (* chi: estimates chi squared from degrees of freedom Tom Schneider, 1988 *) label 1; (* end of program *) const (* begin module version *) version = 1.04; (* of chi.p 1994 Sep 5 origin 1988 July 12 *) (* end module version *) (* begin module describe.chi *) (* name chi: estimates chi squared from degrees of freedom synopsis chi(input, output); files input: degrees of freedom output: messages to the user description estimates chi squared, given degrees of freedom. documentation @book{Finberg1978, author = "S. Finberg", title = "Analysis of Cross Classified Catagorical Data", publisher = "MIT Press", address = "Cambridge, Mass?", year = "1978", comment = "from Chip Lawrence, S=Steven"} appendix iii author Thomas Dana Schneider bugs it's only an estimate *) (* end module describe.chi *) (* begin module chi.themain *) procedure themain; (* the main procedure of the program *) var df: integer; (* degrees of freedom *) begin writeln(output,'chi ',version:4:2); writeln(output,'give degrees of freedom: '); readln(input,df); if df <= 6 then writeln(output,'WARNING: degrees too small'); if df > 100 then writeln(output,'WARNING: degrees too big'); writeln(output); writeln(output,'NOTE: result is around 1.3% off'); writeln(output); writeln(output,'for chi squared is'); writeln(output,'significance '); writeln(output,'0.1 ',sqr(sqrt(df)+0.833):8:2); writeln(output,'0.05 ',sqr(sqrt(df)+1.115):8:2); writeln(output,'0.025 ',sqr(sqrt(df)+1.365):8:2); writeln(output,'0.010 ',sqr(sqrt(df)+1.662):8:2); writeln(output,'0.005 ',sqr(sqrt(df)+1.867):8:2); end; (* end module chi.themain *) begin themain; 1: end.