# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # # EPage 311 # #----- DF = read.csv("../../Data/table_1_4.csv") print( colMeans( DF[,-1] ) ) print( apply( DF[,-1], 2, median ) ) print( apply( DF[,-1], 2, min ) ) print( apply( DF[,-1], 2, max) ) # Plot cumulative frequency distribution for each feature: # #postscript("../../WriteUp/Graphics/Chapter1/ex_2_ecdfs.eps", onefile=FALSE, horizontal=FALSE) par(mfrow=c(1,3)) plot( ecdf( DF$CEO.Salary ), main="Salary" ) plot( ecdf( DF$Sales ), main="Sales" ) plot( ecdf( DF$Return.on.Equity ), main="ROE" ) par(mfrow=c(1,1)) #dev.off() # Plot some scatter plots: # #postscript("../../WriteUp/Graphics/Chapter1/ex_2_scatter_plots.eps", onefile=FALSE, horizontal=FALSE) par(mfrow=c(1,2)) plot( DF$Sales, DF$CEO.Salary, pch=20, cex=1.5, xlab='Sales', ylab='CEO Salary' ) grid() plot( DF$Return.on.Equity, DF$CEO.Salary, pch=20, cex=1.5, xlab='ROE', ylab='CEO Salary' ) grid() par(mfrow=c(1,1)) #dev.off()