options ls=78; title "Eigenvalues and Eigenvectors - Wechsler Data"; /* The first two lines define the name of the data set with the name 'wechsler' * and specify the path where the contents of the data set are read from. * Since we have a header row, the first observation begins on the 2nd row, * and the delimiter option is needed because columns are separated by commas. * The input statement is where we provide names for the variables in order * of the columns in the data set. If any were categorical (not the case here), * we would need to put a '$' character after its name. */ data wechsler; infile "D:\Statistics\STAT 505\data\wechsler.csv" firstobs=2 delimiter=','; input id info sim arith pict; run; /* This prints the specified variable(s) from the data set 'wechsler'. * Since no variables are specified, all are printed. */ proc print data=wechsler; run; /* The princomp procedure calculates the eigenvalues and eigenvectors * for the variables specified in the var statement. The default is * to operate on the correlation matrix of the data, but the 'cov' option * indicates to use the covariance matrix instead. */ proc princomp data=wechsler cov; var info sim arith pict; run;