|
libname psyc 'F:\Psyc
281\HWK1';
/*Proc Corr is the sas
procedure that produces correlation and covariance output*/
/*to correlate a set of variables list them on the var line*/
proc corr cov data=psyc.hwk1;
var iq concept;
run;
/*Proc gplot is the standard graphics
procedure for producing high quality 2d graphics*/
/*This code gives you a scatter plot*/
proc gplot data=PSYC.HWK1;
plot iq*concept;
run;
/*Proc KDE is an advanced kernel density estimation procedure -- the
bivar statement asks for information about
bivariate
relationships*/
proc kde data=psyc.hwk1;
bivar iq concept/ out=density_GP;/*here I output a data set called density_gp
containing the results of proc kde*/
run;
/*In this data step I rename the kde
output to make it more interpretable*/
/*I name the new data set (defined on the DATA line) the same as the
old one (defined on the SET line)*/
data density_GP;
set density_GP;
iq=value1;
concept=value2;
jointDensity=density;
run;
/*Proc G3d is the SAS procedure that returns the 3d surface plots*/
/*Here I am plotting the joint distribution of x1 and x2*/
proc g3d data=density_GP;
plot iq*concept=jointDensity / ctop=black cbottom=salmon;
/*Color
specifications -- top of surface is black, bottom is salmon*/
run;
/*Proc GLM produces regression and ANOVA results -- here we are
predicting self-concept from gender and iq*/
proc glm data=PSYC.HWK1;
model concept=gender iq;
run;
/*This syntax deletes previously generated graphics -- must close
graphics window before invoking*/
PROC CATALOG
CAT=WORK.GSEG KILL;
RUN;
|