1) (Use R; submit your R code) The data file baseball.csv contains statistics on 797 baseball players from the rosters of all major league teams in November, 2004. a) Take a stratified sample of 150 players from the file, using proportional allocation with the different teams as strata. b) Find the mean of the variable logsal using your stratified sample, and interval. give a 95% confidence c) Estimate the proportion of players in the data set who are pitchers, and give a 95% confidence interval. d) Estimate the sample variances in each worthwhile for this problem? Here is the baseball.csv data. stratum. Do you think optimal allocation would be B с D E F G H J K L M N ° P Q R S T U V W X Y Z AA AB AC AD AE AF 1 team leagueID player salary POS G GS InnOuts PO A E DP PB GB AB R H SecB ThiB HR RBI SB CS BB SO IBB HBP SH SF GIDP pitcher 2 ANA AL anderga0 6200000 CF 112 3 ANA AL colonba0 1.1E+07 P 3 4 ANA AL davanje0 375000 CF 108 5 ANA AL donnebro 375000 P 5 6 ANA AL eckstda0 2150000 SS 142 136 7 ANA AL erstada0 7750000 1B 125 124 8 ANA AL escobke0 5750000 P 1 9 ANA AL figgicho 320000 3B 148 10 ANA AL glaustro 9900000 3B 58 11 ANA AL greggke0 301500 P 5 12 ANA AL guerrvlo 1.1E+07 RF 156 143 13 ANA AL guilljoo 2200000 LF 148 14 ANA AL haltesh0 575000 3B 46 15 ANA AL kenneado 2500000 2B 144 16 ANA AL lackejoo 375000 P 2 17 ANA AL molinbe0 2025000 C 97 18 ANA AL molinjo0 335000 C 73 19 ANA AL ortizra0 3266667 P 1 20 ANA AL pauljo01 335000 C 46 21 ANA AL percitro 7833333 P 22 ANA AL rodrifro 375000 P ww 23 ANA AL salmoti0 9900000 RF 60 24 ANA AL seleaa01 8666667 P 1 25 ANA AL shielsco 375000 P 3 26 ANA AL washbja0 5450000 P 3 27 ANA AL weberbe0 900000 P 18 28 ARI NL alomaro0 1000000 2B 38 29 ARI NL baergca0 1000000 1B 79 30 ARI NL bautida0 4000000 RF 141 31 ARI NL choatra0 325750 P 69 32 ARI NL cintral0 335000 SS 154 33 ARI NL colbrgro 2750000 1B 20 34 ARI NL daiglca0 300000 P 11 35 ARI NL desseelo 4000000 P 36 36 ARI NL estalbo0 550000 C 7 8ཎྚཎ॰8ཊཿ་8°Nསྐྱལྐ⌘hl༠༠°nཟླ༠༢°ཀླ༥%°8༄༠༠ 92 2375 211 5 2 1 NA 112 442 57 133 34 625 8 30 3 4 NA 3 3 0 27 743 75 1 0 1 NA 108 285 41 0 126 2 3575 198 3196 986 66 33 625 16 80 2116 57 19 495 11 27 0 263 2 3702 308 135 3471 266 22 640 26 138 3675 255 32 595 15 89 2286 597 57 1573 441 14 384 6 16 504 134 0 149 1 0 252 5 5 117 15 24 396 3 0 316 6 25 448 3 0 67 0 23 610 48 4 107 32 135 3536 265 0 152 3 125 3297 141 1 27 7 10 147 5 9 256 5 3 92 19 288222522482512239-022034802-622 0 Ο ΝΑ 5 0 0 6 75 NA 142 566 92 156 4 83 NA 125 495 0 1 NA 1 2 79 0 146 11 9 NA 148 577 83 171 2 2 NA 58 207 47 0 1 NA 5 0 0 9 2 NA 156 612 124 206 6 1 NA 148 565 88 10 2 NA 46 114 10 12 71 NA 144 468 70 0 1 NA 2 2 0 3 5 6 97 337 36 37 3 4 3 73 203 26 2 1 NA 1 3 0 1 2 2 46 70 11 0 Ο ΝΑ 3 0 0 0 Ο ΝΑ 3 0 0 0 Ο ΝΑ 60 186 15 2 2 NA 1 1 0 1 Ο ΝΑ 3 1 0 1 2 NA 3 5 0 0 Ο ΝΑ 18 0 0 3 10 NA 38 110 14 0 2 NA 79 85 6 4 1 NA 141 539 64 0 1 NA 69 1 0 15 61 NA 154 564 56 ༢॰R°g¥°⪜g• 8 8ཀླg☁%%° °°!¥°༠ས༠༣8g°ཝ་ 20 1 14 75 2 1 29 75 6 1 0 3 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 79 11 4 7 34 18 3 46 54 2 0 1 5 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 24 1 2 35 16 5 42 49 1 13 14 2 11 0 29 1 7 69 16 1 37 74 1 4 3 4 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 22 17 5 60 34 13 49 94 0 0 10 2 6 0 52 11 1 18 42 2 3 31 52 3 3 0 1 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 39 2 39 126 15 3 52 74 14 8 0 8 19 0 166 28 3 27 104 5 4 37 92 5 15 0 3 14 0 23 5 0 4 13 1 1 7 30 0 0 0 0 3 0 130 20 5 10 48 15 5 41 92 7 13 9 2 10 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 93 13 0 10 54 0 1 18 35 1 2 2 4 18 0 53 10 2 3 25 4 1 10 52 0 0 5 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 17 3 0 2 10 2 1 7 17 0 0 3 1 2 0 0 0 0 0 0 0 0 0 0 Ο ΝΑ 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 47 7 0 2 23 1 0 14 41 0 2 0 4 2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 5 2 3 16 0 2 12 18 0 1 2 0 2 0 20 2 0 2 11 0 0 6 12 0 3 0 0 7 0 154 27 1 11 65 6 2 35 66 2 4 1 3 20 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 148 31 7 4 49 3 3 31 59 2 2 12 4 11 0 0 Ο ΝΑ 20 27 1 3 0 0 0 1 0 0 1 5 0 0 0 0 0 0 0 Ο ΝΑ 11 17 2 2 2 0 0 0 0 0 0 7 0 0 1 0 1 1 1 Ο ΝΑ 36 18 0 3 2 0 0 0 0 0 3 3 0 0 4 0 1 1 0 0 0 7 14 2 2 0 0 2 4 0 0 0 6 0 0 0 0 0 0 = = 2000000 co ་ baseball (+

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question
Hi, could you please solve the questions using R?
For the data, please use the data I attached in the screenshot.
(I tried to upload the data, but the program would not let me)
So, solve the questions based on the data I uploaded.
 
Thank you
1)
(Use R; submit your R code) The data file baseball.csv contains statistics on 797 baseball players
from the rosters of all major league teams in November, 2004.
a) Take a stratified sample of 150 players from the file, using proportional allocation with the different
teams as strata.
b) Find the mean of the variable logsal using your stratified sample, and
interval.
give a 95% confidence
c) Estimate the proportion of players in the data set who are pitchers, and give a 95% confidence
interval.
d) Estimate the sample variances in each
worthwhile for this problem?
Here is the baseball.csv data.
stratum. Do you think optimal allocation would be
B
с
D E
F
G
H
J
K
L
M
N
°
P
Q
R
S
T
U
V
W
X
Y
Z
AA
AB
AC
AD
AE
AF
1 team
leagueID player salary POS
G
GS
InnOuts
PO
A
E
DP
PB
GB
AB
R
H
SecB
ThiB
HR
RBI
SB
CS
BB
SO
IBB
HBP
SH
SF
GIDP
pitcher
2 ANA
AL
anderga0 6200000 CF
112
3 ANA
AL
colonba0
1.1E+07 P
3
4 ANA
AL
davanje0
375000 CF
108
5 ANA
AL
donnebro
375000 P
5
6 ANA
AL
eckstda0
2150000 SS
142
136
7 ANA
AL
erstada0
7750000 1B
125
124
8 ANA
AL
escobke0
5750000 P
1
9 ANA
AL
figgicho
320000 3B
148
10 ANA
AL
glaustro
9900000 3B
58
11 ANA
AL
greggke0
301500 P
5
12 ANA
AL
guerrvlo
1.1E+07 RF
156
143
13 ANA
AL
guilljoo
2200000 LF
148
14 ANA
AL
haltesh0
575000 3B
46
15 ANA
AL
kenneado 2500000 2B
144
16 ANA
AL
lackejoo
375000 P
2
17 ANA
AL
molinbe0
2025000 C
97
18 ANA
AL
molinjo0
335000 C
73
19 ANA
AL
ortizra0
3266667 P
1
20 ANA
AL
pauljo01
335000 C
46
21 ANA
AL
percitro
7833333 P
22 ANA
AL
rodrifro
375000 P
ww
23 ANA
AL
salmoti0
9900000 RF
60
24 ANA
AL
seleaa01
8666667 P
1
25 ANA
AL
shielsco
375000 P
3
26 ANA
AL
washbja0 5450000 P
3
27 ANA
AL
weberbe0 900000 P
18
28 ARI
NL
alomaro0 1000000 2B
38
29 ARI
NL
baergca0 1000000 1B
79
30 ARI
NL
bautida0
4000000 RF
141
31 ARI
NL
choatra0
325750 P
69
32 ARI
NL
cintral0
335000 SS
154
33 ARI
NL
colbrgro
2750000 1B
20
34 ARI
NL
daiglca0
300000 P
11
35 ARI
NL
desseelo
4000000 P
36
36 ARI
NL
estalbo0
550000 C
7
8ཎྚཎ॰8ཊཿ་8°Nསྐྱལྐ⌘hl༠༠°nཟླ༠༢°ཀླ༥%°8༄༠༠
92
2375
211
5
2
1 NA
112
442
57
133
34
625
8
30
3
4 NA
3
3
0
27
743
75
1
0
1 NA
108
285
41
0
126
2
3575
198
3196
986
66
33
625
16
80
2116
57
19
495
11
27
0
263
2
3702
308
135
3471
266
22
640
26
138
3675
255
32
595
15
89
2286
597
57
1573
441
14
384
6
16
504
134
0
149
1
0
252
5
5
117
15
24
396
3
0
316
6
25
448
3
0
67
0
23
610
48
4
107
32
135
3536
265
0
152
3
125
3297
141
1
27
7
10
147
5
9
256
5
3
92
19
288222522482512239-022034802-622
0
Ο ΝΑ
5
0
0
6
75 NA
142
566
92
156
4
83 NA
125
495
0
1 NA
1
2
79
0
146
11
9 NA
148
577
83
171
2
2 NA
58
207
47
0
1 NA
5
0
0
9
2 NA
156
612
124
206
6
1 NA
148
565
88
10
2 NA
46
114
10
12
71 NA
144
468
70
0
1 NA
2
2
0
3
5
6
97
337
36
37
3
4
3
73
203
26
2
1 NA
1
3
0
1
2
2
46
70
11
0
Ο ΝΑ
3
0
0
0
Ο ΝΑ
3
0
0
0
Ο ΝΑ
60
186
15
2
2 NA
1
1
0
1
Ο ΝΑ
3
1
0
1
2 NA
3
5
0
0
Ο ΝΑ
18
0
0
3
10 NA
38
110
14
0
2 NA
79
85
6
4
1 NA
141
539
64
0
1 NA
69
1
0
15
61 NA
154
564
56
༢॰R°g¥°⪜g• 8 8ཀླg☁%%° °°!¥°༠ས༠༣8g°ཝ་
20
1
14
75
2
1
29
75
6
1
0
3
3
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
79
11
4
7
34
18
3
46
54
2
0
1
5
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
24
1
2
35
16
5
42
49
1
13
14
2
11
0
29
1
7
69
16
1
37
74
1
4
3
4
9
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
22
17
5
60
34
13
49
94
0
0
10
2
6
0
52
11
1
18
42
2
3
31
52
3
3
0
1
6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
39
2
39
126
15
3
52
74
14
8
0
8
19
0
166
28
3
27
104
5
4
37
92
5
15
0
3
14
0
23
5
0
4
13
1
1
7
30
0
0
0
0
3
0
130
20
5
10
48
15
5
41
92
7
13
9
2
10
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
93
13
0
10
54
0
1
18
35
1
2
2
4
18
0
53
10
2
3
25
4
1
10
52
0
0
5
0
6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
17
3
0
2
10
2
1
7
17
0
0
3
1
2
0
0
0
0
0
0
0
0
0
0
Ο ΝΑ
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
47
7
0
2
23
1
0
14
41
0
2
0
4
2
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
2
0
0
0
1
0
0
0
0
0
0
2
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
34
5
2
3
16
0
2
12
18
0
1
2
0
2
0
20
2
0
2
11
0
0
6
12
0
3
0
0
7
0
154
27
1
11
65
6
2
35
66
2
4
1
3
20
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
148
31
7
4
49
3
3
31
59
2
2
12
4
11
0
0
Ο ΝΑ
20
27
1
3
0
0
0
1
0
0
1
5
0
0
0
0
0
0
0
Ο ΝΑ
11
17
2
2
2
0
0
0
0
0
0
7
0
0
1
0
1
1
1
Ο ΝΑ
36
18
0
3
2
0
0
0
0
0
3
3
0
0
4
0
1
1
0
0
0
7
14
2
2
0
0
2
4
0
0
0
6
0
0
0
0
0
0
=
=
2000000 co
་
baseball
(+
Transcribed Image Text:1) (Use R; submit your R code) The data file baseball.csv contains statistics on 797 baseball players from the rosters of all major league teams in November, 2004. a) Take a stratified sample of 150 players from the file, using proportional allocation with the different teams as strata. b) Find the mean of the variable logsal using your stratified sample, and interval. give a 95% confidence c) Estimate the proportion of players in the data set who are pitchers, and give a 95% confidence interval. d) Estimate the sample variances in each worthwhile for this problem? Here is the baseball.csv data. stratum. Do you think optimal allocation would be B с D E F G H J K L M N ° P Q R S T U V W X Y Z AA AB AC AD AE AF 1 team leagueID player salary POS G GS InnOuts PO A E DP PB GB AB R H SecB ThiB HR RBI SB CS BB SO IBB HBP SH SF GIDP pitcher 2 ANA AL anderga0 6200000 CF 112 3 ANA AL colonba0 1.1E+07 P 3 4 ANA AL davanje0 375000 CF 108 5 ANA AL donnebro 375000 P 5 6 ANA AL eckstda0 2150000 SS 142 136 7 ANA AL erstada0 7750000 1B 125 124 8 ANA AL escobke0 5750000 P 1 9 ANA AL figgicho 320000 3B 148 10 ANA AL glaustro 9900000 3B 58 11 ANA AL greggke0 301500 P 5 12 ANA AL guerrvlo 1.1E+07 RF 156 143 13 ANA AL guilljoo 2200000 LF 148 14 ANA AL haltesh0 575000 3B 46 15 ANA AL kenneado 2500000 2B 144 16 ANA AL lackejoo 375000 P 2 17 ANA AL molinbe0 2025000 C 97 18 ANA AL molinjo0 335000 C 73 19 ANA AL ortizra0 3266667 P 1 20 ANA AL pauljo01 335000 C 46 21 ANA AL percitro 7833333 P 22 ANA AL rodrifro 375000 P ww 23 ANA AL salmoti0 9900000 RF 60 24 ANA AL seleaa01 8666667 P 1 25 ANA AL shielsco 375000 P 3 26 ANA AL washbja0 5450000 P 3 27 ANA AL weberbe0 900000 P 18 28 ARI NL alomaro0 1000000 2B 38 29 ARI NL baergca0 1000000 1B 79 30 ARI NL bautida0 4000000 RF 141 31 ARI NL choatra0 325750 P 69 32 ARI NL cintral0 335000 SS 154 33 ARI NL colbrgro 2750000 1B 20 34 ARI NL daiglca0 300000 P 11 35 ARI NL desseelo 4000000 P 36 36 ARI NL estalbo0 550000 C 7 8ཎྚཎ॰8ཊཿ་8°Nསྐྱལྐ⌘hl༠༠°nཟླ༠༢°ཀླ༥%°8༄༠༠ 92 2375 211 5 2 1 NA 112 442 57 133 34 625 8 30 3 4 NA 3 3 0 27 743 75 1 0 1 NA 108 285 41 0 126 2 3575 198 3196 986 66 33 625 16 80 2116 57 19 495 11 27 0 263 2 3702 308 135 3471 266 22 640 26 138 3675 255 32 595 15 89 2286 597 57 1573 441 14 384 6 16 504 134 0 149 1 0 252 5 5 117 15 24 396 3 0 316 6 25 448 3 0 67 0 23 610 48 4 107 32 135 3536 265 0 152 3 125 3297 141 1 27 7 10 147 5 9 256 5 3 92 19 288222522482512239-022034802-622 0 Ο ΝΑ 5 0 0 6 75 NA 142 566 92 156 4 83 NA 125 495 0 1 NA 1 2 79 0 146 11 9 NA 148 577 83 171 2 2 NA 58 207 47 0 1 NA 5 0 0 9 2 NA 156 612 124 206 6 1 NA 148 565 88 10 2 NA 46 114 10 12 71 NA 144 468 70 0 1 NA 2 2 0 3 5 6 97 337 36 37 3 4 3 73 203 26 2 1 NA 1 3 0 1 2 2 46 70 11 0 Ο ΝΑ 3 0 0 0 Ο ΝΑ 3 0 0 0 Ο ΝΑ 60 186 15 2 2 NA 1 1 0 1 Ο ΝΑ 3 1 0 1 2 NA 3 5 0 0 Ο ΝΑ 18 0 0 3 10 NA 38 110 14 0 2 NA 79 85 6 4 1 NA 141 539 64 0 1 NA 69 1 0 15 61 NA 154 564 56 ༢॰R°g¥°⪜g• 8 8ཀླg☁%%° °°!¥°༠ས༠༣8g°ཝ་ 20 1 14 75 2 1 29 75 6 1 0 3 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 79 11 4 7 34 18 3 46 54 2 0 1 5 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 24 1 2 35 16 5 42 49 1 13 14 2 11 0 29 1 7 69 16 1 37 74 1 4 3 4 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 22 17 5 60 34 13 49 94 0 0 10 2 6 0 52 11 1 18 42 2 3 31 52 3 3 0 1 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 39 2 39 126 15 3 52 74 14 8 0 8 19 0 166 28 3 27 104 5 4 37 92 5 15 0 3 14 0 23 5 0 4 13 1 1 7 30 0 0 0 0 3 0 130 20 5 10 48 15 5 41 92 7 13 9 2 10 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 93 13 0 10 54 0 1 18 35 1 2 2 4 18 0 53 10 2 3 25 4 1 10 52 0 0 5 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 17 3 0 2 10 2 1 7 17 0 0 3 1 2 0 0 0 0 0 0 0 0 0 0 Ο ΝΑ 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 47 7 0 2 23 1 0 14 41 0 2 0 4 2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 5 2 3 16 0 2 12 18 0 1 2 0 2 0 20 2 0 2 11 0 0 6 12 0 3 0 0 7 0 154 27 1 11 65 6 2 35 66 2 4 1 3 20 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 148 31 7 4 49 3 3 31 59 2 2 12 4 11 0 0 Ο ΝΑ 20 27 1 3 0 0 0 1 0 0 1 5 0 0 0 0 0 0 0 Ο ΝΑ 11 17 2 2 2 0 0 0 0 0 0 7 0 0 1 0 1 1 1 Ο ΝΑ 36 18 0 3 2 0 0 0 0 0 3 3 0 0 4 0 1 1 0 0 0 7 14 2 2 0 0 2 4 0 0 0 6 0 0 0 0 0 0 = = 2000000 co ་ baseball (+
Expert Solution
steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman