Explain how to find the deviation of an entry in a data set. What is the sumof all the deviations in any data set?

# 9.26 # Variable selection (step wise selection) (Ch6) data=read.csv(file.choose()) data=data[-1] # x1:x7 are quantative factors # We will try to use all 7 independent varibales (predictors) to predict y (exclude the first column) m1=lm(y~.,data) # m1 is not adequate to predict y # Before fitting regression, check correlations first cor.test(data[,2], data[,3])$p.value cor.test(data[,2], data[,4])$p.value cor.test(data[,2], data[,5])$p.value cor.test(data[,2], data[,6])$p.value cor.test(data[,2], data[,7])$p.value # non is significant # try to apply coding procedure to minimize the standard error # create a new matrix and store the coding procedure variables data1=matrix(0,nrow(data), 8) for (j in 2:9){ data1[,j-1]=(data[,j]-mean(data[,j]))/sd(data[,j])