1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 /*************************** berkeley.sas *********************************/
57 title 'Berkeley Graduate Admissions Data: ';
58
59 proc format;
60 value sexfmt 1 = 'Female' 0 = 'Male';
NOTE: Format SEXFMT is already on the library WORK.FORMATS.
NOTE: Format SEXFMT has been output.
61 value ynfmt 1 = 'Yes' 0 = 'No';
NOTE: Format YNFMT is already on the library WORK.FORMATS.
NOTE: Format YNFMT has been output.
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
62 data berkley;
63 input line sex dept $ admit count;
64 format sex sexfmt.; format admit ynfmt.;
65 datalines;
NOTE: The data set WORK.BERKLEY has 24 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.02 seconds
90 ;
91 proc freq;
92 tables sex*admit / nopercent nocol chisq;
93 tables dept*sex*admit / nopercent nocol chisq;
94 tables dept*sex / nopercent nocol chisq;
95 tables dept*admit / nopercent nocol chisq;
96 weight count;
97
98
99 /* Get p-value */
NOTE: There were 24 observations read from the data set WORK.BERKLEY.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.50 seconds
cpu time 0.49 seconds
100 proc iml;
NOTE: IML Ready
101 x = 17.2480 + 0.2537 + 0.7535 + 0.2980 + 1.0011 + 0.3841;
102 pval = 1-probchi(x,6);
103 print "Pooled chisquare = " x "df=6, p = " pval;
104 Bonferroni = 0.05/6;
105 print "Reject with Bonferroni correction if p <" Bonferroni;
106
107
108 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
120