20.01.2015 Views

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

290<br />

Columns 12 through 15<br />

'LF_pcoh_"HF_pcoh_"HF_pcoh_"HF_pcog:<br />

'BP_rsp' 'HR_rsp' 'HR BP' 'BP_rsp'<br />

3. To get a quick impression <strong>of</strong> the ratings data, make a box plot.<br />

>> boxplot(cpdata,O,'+',0)<br />

>> set(gca,'YTicklabel',categories)<br />

These commands generate the plot below. Note that there is substantially more<br />

variability in the ratings <strong>of</strong> the arts and housing than in the ratings <strong>of</strong> crime and climate.<br />

Ordinarily one might also graph pairs <strong>of</strong> the original variables, but there are too<br />

many two-variable plots. Perhaps principal components analysis can reduce the number<br />

<strong>of</strong> variables we need to consider.<br />

Sometimes it makes sense to compute principal components for raw data. This is<br />

appropriate when all the variables are in the same units. Standardizing the data is<br />

reasonable when the variables are in different units or when the variance <strong>of</strong> the different<br />

columns is substantial (as in this case).<br />

4. One can standardize the data by dividing each column by its standard deviation.<br />

>> stdr = std(cpdata);<br />

>> sr = cpdata./repmat(stdr,55,1);<br />

5. Now it is ready to find the principal components.<br />

>> [pcs,newdata,variances,t2] = princomp(sr);<br />

The following sections explain the four outputs from princomp:<br />

•"The Principal Components (First Output)"<br />

•"The Component Scores (Second Output)"

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!