njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology njit-etd2003-081 - New Jersey Institute of Technology

archives.njit.edu
from archives.njit.edu More from this publisher
20.01.2015 Views

293 >> normal = [48 49 50 51 52 53 54 55]; >> names(normal,:) ans = ba ja rajf rajm ka ma ro so 10. To remove these rows from the ratings matrix, type the following. >> rsubset = cpdata; >> nsubset = names; >> nsubset(normal,:) = [ ]; >> rsubset(normal,:) = [ ]; >> size(rsubset) ans = 47 15 11. To practice, repeat the analysis using the variable rsubset as the new data matrix and nsubset as the string matrix of labels. The Component Variances (Third Output) 12. The third output, variances, is a vector containing the variance explained by the corresponding column of newdata. >> variances

294 variances = 3.4083 1.2140 1.1415 0.9209 0.7533 0.6306 0.4930 0.3180 0.1204 13. One can easily calculate the percent of the total variability explained by each principal component. >> percent_explained = 100*variances/sum(variances) percent_explained = 37.8699 13.4886 12.6831 10.2324 8.3698 7.0062 5.4783 3.5338 1.3378 14. A "Scree" plot is a pareto plot of the percent variability explained by each principal component. >> pareto(percent_explained) >> xlabel('Principal Component') >> ylabel('Variance Explained (%)') We can see that the first three principal components explain roughly two thirds of the total variability in the standardized ratings.

293<br />

>> normal = [48 49 50 51 52 53 54 55];<br />

>> names(normal,:)<br />

ans =<br />

ba<br />

ja<br />

rajf<br />

rajm<br />

ka<br />

ma<br />

ro<br />

so<br />

10. To remove these rows from the ratings matrix, type the following.<br />

>> rsubset = cpdata;<br />

>> nsubset = names;<br />

>> nsubset(normal,:) = [ ];<br />

>> rsubset(normal,:) = [ ];<br />

>> size(rsubset)<br />

ans =<br />

47 15<br />

11. To practice, repeat the analysis using the variable rsubset as the new data matrix<br />

and nsubset as the string matrix <strong>of</strong> labels.<br />

The Component Variances (Third Output)<br />

12. The third output, variances, is a vector containing the variance explained by the<br />

corresponding column <strong>of</strong> newdata.<br />

>> variances

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

Saved successfully!

Ooh no, something went wrong!