Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USING THE DATA ABOVE Problem 3. BANK DATA The file http://omega.albany.edu: 08/b

ID: 3234703 • Letter: U

Question

USING THE DATA ABOVE

Problem 3. BANK DATA The file http://omega.albany.edu: 08/bank.txt contains measurements of four variables (rl,z2,z3,r4 see below) on dollar bills. Some of the dollar bills are genuine (labeled with y 0) and some dollar bills are counterfeit (with y 1). zl length of the bill (in mm) r2 width of the left edge lin mm) r3 width of the right edge (in mm) r4 bottom margin width (in mm) The response variable y: is 0 for genuine bills and it is 1 for the counterfeit bills. Visualize the explanatory variables with scatterplotMatrix dividing the data i two groups (genuine, counterfeit). Looking at these pictures consider the following statements: (1). r1 is about symmetric, T2 is skewed to the left, z3 is also skewed to the left, and 24 is skewed to the right (2). r2 and ac3 seem the most correlated. (3). z2 vs. r3 tend to separate the groups (0,1) as (left, write (4). z4 vs. r2 tend to separate the groups (0.1) as (down,up) Which of the above statements are correct? O A. They are all correct. O B. (1) and (2) correct but (3) and (4) are false O D. All but (4) are correct O E. They are all false. Answer:

Explanation / Answer

6) The funciton is

normalize.df <- function(df, cols) {
result <- df # copy of the input data frame
  
for (j in cols) { # each specified col
m <- mean(df[,j]) # column mean
std <- sd(df[,j]) # column sd
  
for (i in 1:nrow(result)) { # each row of cur col
result[i,j] <- (result[i,j] - m) / std
}
}
return(result)
}

## pass the column names of the dataframe
cols<- c("x_1","x_2")

## run the funciton
normalize.df(data.df,cols)

#######

we dont have the bank data given in the question , so i shall show you the results for a hypothetical dataset

normalize.df(data.df,cols)
y x_1 x_2 x_3 x_4 x_5 x_6
1 10 2.01122809 -0.443849377 582 6.0 7.05 36
2 13 0.72451455 -0.660363380 132 8.2 48.52 100
3 12 0.12958248 -0.017920191 716 8.7 20.66 67
4 17 -0.53452773 -0.016145486 515 9.0 12.95 86
5 56 -0.92192536 -0.090683094 158 9.0 43.37 127
6 36 -0.24397951 -0.679885134 80 9.0 40.25 114
7 29 0.21259626 -0.051639585 757 9.3 38.89 111
8 14 1.74835113 -0.580501658 529 8.8 54.47 116
9 10 2.73068082 -0.454497607 335 9.0 59.80 128
10 24 0.79369270 -0.168770111 497 9.1 48.34 115
11 110 -0.71439092 5.112751794 3369 10.4 34.44 122
12 28 -0.47918522 -0.181193046 746 9.7 38.74 121
13 17 -0.93576099 -0.637292216 201 11.2 30.85 103
14 8 0.11574685 -0.600023412 277 12.7 30.58 82
15 30 -0.02260944 -0.305422392 593 8.3 43.11 123
16 9 1.73451550 -0.459821722 361 8.4 56.77 113
17 47 -0.10562322 0.287329059 905 9.6 41.31 111
18 35 -0.81124032 1.066424528 1513 10.1 30.96 129
19 29 -1.69672061 0.418657224 744 10.6 25.94 137
20 14 -0.17480137 -0.145698947 507 10.0 37.00 99
21 56 0.01889745 0.553534800 622 9.5 35.89 105
22 14 -0.58987025 -0.500639935 347 10.9 30.18 98
23 11 0.14341811 -0.740225102 244 8.9 7.77 58
24 46 -1.12945980 -0.743774512 116 8.8 33.36 135
25 11 -1.19863795 -0.127951898 463 12.4 36.11 166
26 23 -0.24397951 -0.001947847 453 7.1 39.04 132
27 65 -0.83891158 0.965266346 751 10.9 34.99 155
28 26 -0.58987025 -0.349790015 540 8.6 37.01 134
29 69 -0.16096574 2.180939231 1950 9.6 39.93 115
30 61 -0.74206218 -0.206038915 520 9.4 36.22 147
31 94 -0.79740469 -0.213137735 179 10.6 42.75 125
32 10 0.80752833 -0.223785965 624 9.2 49.10 105
33 18 0.50314448 -0.333817671 448 7.9 46.00 119
34 9 1.44396728 0.315724338 844 10.9 35.94 78
35 10 1.81752928 0.457700733 1233 10.8 48.19 103
36 28 -0.65904840 -0.578726953 176 8.7 15.17 89
37 31 0.48930885 -0.651489855 308 10.6 44.68 116
38 26 0.28177441 -0.472244656 299 7.6 42.59 115
39 29 -0.64521277 -0.149248357 531 9.4 38.79 164
40 31 -0.07795196 -0.759746857 71 6.5 40.75 148
41 16 -1.39233676 0.187945582 717 11.8 29.07 123

Hope this helps !!!

Please note that we can answer only 1 full question at a time , as per the answering guidelines