Question: This is programmed in MATLAB. Please provide the code for PART D PART E. This should be organized with a PIPELINE/WORKFLOW style What part E

This is programmed in MATLAB. Please provide the code for PART D PART E. This should be organized with a PIPELINE/WORKFLOW style

This is programmed in MATLAB. Please provide the code for PART DPART E. This should be organized with a PIPELINE/WORKFLOW style What partE should look like: D survived ticket 24160 L221 em todo o

What part E should look like:

13502 L77 A B 1 row.names pclass 1 1st 2 1st 3

D survived ticket 24160 L221 em todo o 13502 L77 A B 1 row.names pclass 1 1st 2 1st 3 1st 4 1st 5 1st 6 1st 7 1st 8 1st 9 1st 10 1st 11 1st 12 1st 13 1st 14 1st 15 1st 16 1st 17 1st 18 1st 19 1st 20 1st 21 1st name 1 Allen, Miss Elisabeth Walton 0 Allison, Miss Helen Loraine O Allison, Mr Hudson Joshua Creighton O Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) 1 Allison, Master Hudson Trevor 1 Anderson, Mr Harry 1 Andrews, Miss Kornelia Theodosia 0 Andrews, Mr Thomas, jr 1 Appleton, Mrs Edward Dale (Charlotte Lamson) 0 Artagaveytia, Mr Ramon 0 Astor, Colonel John Jacob 1 Astor, Mrs John Jacob (Madeleine Talmadge Force) 1 Aubert, Mrs Leontine Pauline 1 Barkworth, Mr Algernon H. O Baumann, Mr John D. 1 Baxter, Mrs James (Helene DeLaudeniere Chaput) 0 Baxter, Mr Quigg Edmond O Beattie, Mr Thomson 1 Beckwith, Mr Richard Leonard 1 Beckwith, Mrs Richard Leonard (Sallie Monypeny) 1 Behr, Mr Karl Howell F age embarked 29 Southampton 2 Southampton 30 Southampton 25 Southampton 0.9167 Southampton 47 Southampton 63 Southampton 39 Southampton 58 Southampton 71 Cherbourg 47 Cherbourg 19 Cherbourg NA Cherbourg NA Southampton Southampton 50 Cherbourg 24 Cherbourg 36 Cherbourg 37 Southampton 47 Southampton 26 Cherbourg H home.dest room St Louis, MO Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C22 New York, NY E-12 Hudson, NY Belfast, NI A-36 Bayside, Queens, NY C-101 Montevideo, Uruguay New York, NY New York, NY Paris, France B-35 Hessle, Yorks A-23 New York, NY Montreal, PQ B-58/60 Montreal, PQ B-58/60 Winnipeg, MN C-6 New York, NY D-35 New York, NY D-35 New York, NY C-148 J K boat sex 2 female female -135 male female 11 male 3 male 10 female male 2 female -22 male -124 male 4 female 9 female male male 6 female male male 5 male 5 female 5 male 17754 L224 10s 6d 17754 L224 10s 6d 17477 L69 65 B NA 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1292 3rd 1293 3rd 1294 3rd 1295 3rd 1296 3rd 1297 3rd 1298 3rd 1299 3rd 1300 3rd 1301 3rd 1302 3rd 1303 3rd 1304 3rd 1305 3rd 1306 3rd 1307 3rd 1308 3rd 1309 3rd 1310 3rd 1311 3rd 1312 3rd 1313 3rd o Widegren, Mr Charles Peter O Wiklund, Mr Jacob Alfred 1 Wilkes, Mrs Ellen 0 Willer, Mr Aaron O Willey, Mr Edward o Williams, Mr Howard Hugh O Williams, Mr Leslie o Windelov, Mr Einar O Wirz, Mr Albert O Wiseman, Mr Phillippe O Wittevrongel, Mr Camiel 1 Yalsevac, Mr Ivan O Yasbeck, Mr Antoni 1 Yasbeck, Mrs Antoni 0 Youssef, Mr Gerios 0 Zabour, Miss Hileni O Zabour, Miss Tamini O Zakarian, Mr Artun O Zakarian, Mr Maprieder o Zenn, Mr Philip O Zievens, Rene O Zimmerman, Leo male male female male male male male male male male male male male female male female female male male male female male 1313 1314 d) Write a function survival (dat) that returns a table that calculates the proportion of passengers that survived by sex and class (use unstack(). e) Write a function plot survival that plots a bar chart that illustrates your result from the previous section. Generate this plot (your figure should be similar to Figure 1). Proportion of survivors by sex and class female male 1st 2nd 3rd D survived ticket 24160 L221 em todo o 13502 L77 A B 1 row.names pclass 1 1st 2 1st 3 1st 4 1st 5 1st 6 1st 7 1st 8 1st 9 1st 10 1st 11 1st 12 1st 13 1st 14 1st 15 1st 16 1st 17 1st 18 1st 19 1st 20 1st 21 1st name 1 Allen, Miss Elisabeth Walton 0 Allison, Miss Helen Loraine O Allison, Mr Hudson Joshua Creighton O Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) 1 Allison, Master Hudson Trevor 1 Anderson, Mr Harry 1 Andrews, Miss Kornelia Theodosia 0 Andrews, Mr Thomas, jr 1 Appleton, Mrs Edward Dale (Charlotte Lamson) 0 Artagaveytia, Mr Ramon 0 Astor, Colonel John Jacob 1 Astor, Mrs John Jacob (Madeleine Talmadge Force) 1 Aubert, Mrs Leontine Pauline 1 Barkworth, Mr Algernon H. O Baumann, Mr John D. 1 Baxter, Mrs James (Helene DeLaudeniere Chaput) 0 Baxter, Mr Quigg Edmond O Beattie, Mr Thomson 1 Beckwith, Mr Richard Leonard 1 Beckwith, Mrs Richard Leonard (Sallie Monypeny) 1 Behr, Mr Karl Howell F age embarked 29 Southampton 2 Southampton 30 Southampton 25 Southampton 0.9167 Southampton 47 Southampton 63 Southampton 39 Southampton 58 Southampton 71 Cherbourg 47 Cherbourg 19 Cherbourg NA Cherbourg NA Southampton Southampton 50 Cherbourg 24 Cherbourg 36 Cherbourg 37 Southampton 47 Southampton 26 Cherbourg H home.dest room St Louis, MO Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C26 Montreal, PQ/ Chesterville, ON C22 New York, NY E-12 Hudson, NY Belfast, NI A-36 Bayside, Queens, NY C-101 Montevideo, Uruguay New York, NY New York, NY Paris, France B-35 Hessle, Yorks A-23 New York, NY Montreal, PQ B-58/60 Montreal, PQ B-58/60 Winnipeg, MN C-6 New York, NY D-35 New York, NY D-35 New York, NY C-148 J K boat sex 2 female female -135 male female 11 male 3 male 10 female male 2 female -22 male -124 male 4 female 9 female male male 6 female male male 5 male 5 female 5 male 17754 L224 10s 6d 17754 L224 10s 6d 17477 L69 65 B NA 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1292 3rd 1293 3rd 1294 3rd 1295 3rd 1296 3rd 1297 3rd 1298 3rd 1299 3rd 1300 3rd 1301 3rd 1302 3rd 1303 3rd 1304 3rd 1305 3rd 1306 3rd 1307 3rd 1308 3rd 1309 3rd 1310 3rd 1311 3rd 1312 3rd 1313 3rd o Widegren, Mr Charles Peter O Wiklund, Mr Jacob Alfred 1 Wilkes, Mrs Ellen 0 Willer, Mr Aaron O Willey, Mr Edward o Williams, Mr Howard Hugh O Williams, Mr Leslie o Windelov, Mr Einar O Wirz, Mr Albert O Wiseman, Mr Phillippe O Wittevrongel, Mr Camiel 1 Yalsevac, Mr Ivan O Yasbeck, Mr Antoni 1 Yasbeck, Mrs Antoni 0 Youssef, Mr Gerios 0 Zabour, Miss Hileni O Zabour, Miss Tamini O Zakarian, Mr Artun O Zakarian, Mr Maprieder o Zenn, Mr Philip O Zievens, Rene O Zimmerman, Leo male male female male male male male male male male male male male female male female female male male male female male 1313 1314 d) Write a function survival (dat) that returns a table that calculates the proportion of passengers that survived by sex and class (use unstack(). e) Write a function plot survival that plots a bar chart that illustrates your result from the previous section. Generate this plot (your figure should be similar to Figure 1). Proportion of survivors by sex and class female male 1st 2nd 3rd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!