# # 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. # #----- DF = read.csv("../../Data/chap_1_prob_14.csv") #postscript("../../WriteUp/Graphics/Chapter1/ex_14_scatter_plot.eps", onefile=FALSE, horizontal=FALSE) plot( DF$LSAT, DF$GPA, type='p', pch=20, cex=1.5, xlab='LSAT', ylab='GPA' ) grid() #dev.off() # Compute statistics of each variable: # print( c( mean( DF$LSAT ), median( DF$LSAT ), sd( DF$LSAT ) ) ) print( c( mean( DF$GPA ), median( DF$GPA ), sd( DF$GPA ) ) ) # Use the "boot" library function: # library(boot) samplemean = function(x, d){ return(mean(x[d])) } res = boot( DF$LSAT, samplemean, 100 ) print(res)