# # Problems and exmaples for the chapter "Basic Statistics" # from the book "Basic Statistics: Understanding Conventional Methods" by # Rand R. Wilcox. # # 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. # #----- source('tmean.R') source('winsorize.R') # Example 1: # data = c( 46,12,33,15,29,19,4,24,11,31,38,69,10 ) tmean( data ) # Example 2: # data = c( 5.1,5.3,5.3,5.5,5.0,5.1,5.4,4.2,5.2 ) tmean( data ) # Example 3: # data = c( 2,3,4,5,6,7,8,9,10,50 ) dw = winsorize( data, p=0.2 ) # Example 4: # data = c( 10,8,22,35,42,2,9,18,27,1,16,29 ) dw = winsorize( data, p=0.2 ) # Example 5: # data = c( 1,2,8,9,10,16,18,22,27,29,35,42 ) dw = winsorize( data, p=0.2 ) mean(dw) var(dw) # Problem 27: # data = c( 80,85,81,75,77,79,74,86,79,55,82,89,73,79,83,82,88,79,77,81,82 ) dw = winsorize( data, p=0.2 ) mean(dw) # Problem 35/36: # data = c( 21,36,42,24,25,36,35,49,32 ) dw = winsorize( data, p=0.2 ) var(dw) var(data)