|
/* Import the dataset */
libname Psyc 'C:\PSYC281';
proc import
out= Psyc.HWK1
datafile= 'C:\PSYC281\ta01_009.txt'
DBMS= TAB REPLACE;
GETNAMES= YES;
DATAROW= 2;
run;
proc print data=hwk1;
run;
/*Problem 1.37b:
Summary statistics and plots for GPA and Self Concept */
proc univariate data=PSYC.HWK1 plot round=.1;
histogram /normal barwidth=6 cfill=red;
var GPA ;
run;
/* Sort the dataset by gender */
proc sort data=PSYC.HWK1;
by gender;
run;
/*Problem 1.37d:
Statistics and plots of GPA by Gender */
proc univariate data=PSYC.HWK1 plot round=.1;
class gender;
histogram /kernel(c=2 k=normal color=blue fill w=3)
HOFFSET=0 midpoints = 3 to 11 by 1;
var GPA;
run;
quit;
/* Problem 1.38:
Summary statistics for IQ, note that we have fitted a
normal curve on the histogram with mean at 100 */
proc univariate mu0=100 data=PSYC.HWK1 plot;
histogram / NORMAL(MU=100) kernel(c=1.7 k=normal color=RED w=3);
var IQ;
run;
quit;
/* Problem 1.39:
Summary statistics for SELF CONCEPT, note that we have fitted a
normal curve on the histogram with mean at 100 */
proc univariate data=PSYC.HWK1 plot NOPRINT;
histogram CONCEPT / kernel(c=1.1 k=normal color=SALMON FILL w=4) CFILL=STEEL;
run;
quit;
|