HIA 226 Assignment 06 Read the following instructions carefully 1. The full mark of this test is 6 points, contributing to 8% of the final grade. 2. Submit the assignment to our digital learning platform 24 hours before the next synchronous session. 3. All submitted work must be typeset, saved in either Microsoft .docx or Adobe .pdf format. 4. In the assignment, number all questions, sections, and subsections clearly. 5. Use a page break a new page for each question. In Microsoft Word, you can press Ctrl + Enter to add a page break. 6. Save the file as “Fist Last Assignment##”. For example, “Ken Chui Assignment01.docx”. 7. Unless being told otherwise, report all up to three significant figures, round up. E.g. Report 12.358 as “12.4” and 0.0025477 as “0.00255”. Scientific notation is also allowed: 2.55 × 10-3 . show your mathematical works, if applicable. show your R syntax codes in monospace font type (e.g. Courier New), if applicable. 8. You are allowed to work in groups to discuss how to approach the questions, but the answer should be written individually. Do not share typed or written answers. 9. You are also encourage to post questions on Piazza.com. Remember to tag the question with the the “assignment” tag. HIA 226: Data Wrangling HIA 226 Assignment 06 Page 2 of 5 R competency The “R competency” questions cover some of what we covered in the video lectures. You may use this as a test of your comprehension. 1. As mentioned in the live session, we have some good amount of coding practics so there will not be new questions here. Instead, we will use the bootcamp in the asynchronous session as this week’s assignment. In this bootcamp we will practice what we learned about SQL. You will need the 100-case phys file to complete the following tasks. Use SQL if you can, but R code is acceptable as a last resort. (a) [1 point] Create a table to show the raw data of systolic and diastolic blood pressure for respondents who are 60 or older and 70 or younger. (b) [1 point] Create a table just like the one above, but add a customized variable called “map”, which stands for “mean artery pressure,” computed as: MAP = SBP + 2 × DBP 3 (1) Order the data by descending mean artery pressure. (c) [2 points] This question may involve two SQL steps. First, create a table that has age, bmi, and a 4-level indicator, which is categorized as: 1. Underweight: BMI < 20="" 2.="" normal="" weight:="" bmi="" ≥="" 20="" &="" bmi="">< 25="" 3.="" overweight:="" bmi="" ≥="" 25="" &="" bmi="">< 30 4. obese: bmi ≥ 30 call the table “fileone”. then, using fileone, generate a summary table showing the i) average and standard deviation of age and ii) number of cases broken down by the 4 weight categories. order the data in ascending order from underweight to obese category. hia 226: data wrangling hia 226 assignment 06 page 3 of 5 learning monitoring the “learning monitoring” questions mostly concern with learning assessment and course engagement. questions under this category always yield full marks as long as they are answered. the instructor will review them before the next meeting and address any questions. 2. thus far, we have learned a few r packages. for this question, i’d like to invite each of you to make a post on piazza to introduce an interesting r package you have found. in your post, state: (a) [1 point] the name of the package, and attach a link to its technical support page if available. (b) [1 point] introduce at least one command with a code example. you may base your answer on sample codes that come with the technical document. the code example should be self-contained, that if another person copied and pasted your code chunk to their r-studio and tried it out, the code should demonstrate the command smoothly. (c) [0 points] browse others’ entries and feel free to provide some feedback! any package is a fair game, it is also acceptable to introduce packages inside tidyverse, as long as the command has not been featured in this course. end of the assignment remember to name this file correctly and submit it through the learning digital platform. hia 226: data wrangling 30="" 4.="" obese:="" bmi="" ≥="" 30="" call="" the="" table="" “fileone”.="" then,="" using="" fileone,="" generate="" a="" summary="" table="" showing="" the="" i)="" average="" and="" standard="" deviation="" of="" age="" and="" ii)="" number="" of="" cases="" broken="" down="" by="" the="" 4="" weight="" categories.="" order="" the="" data="" in="" ascending="" order="" from="" underweight="" to="" obese="" category.="" hia="" 226:="" data="" wrangling="" hia="" 226="" assignment="" 06="" page="" 3="" of="" 5="" learning="" monitoring="" the="" “learning="" monitoring”="" questions="" mostly="" concern="" with="" learning="" assessment="" and="" course="" engagement.="" questions="" under="" this="" category="" always="" yield="" full="" marks="" as="" long="" as="" they="" are="" answered.="" the="" instructor="" will="" review="" them="" before="" the="" next="" meeting="" and="" address="" any="" questions.="" 2.="" thus="" far,="" we="" have="" learned="" a="" few="" r="" packages.="" for="" this="" question,="" i’d="" like="" to="" invite="" each="" of="" you="" to="" make="" a="" post="" on="" piazza="" to="" introduce="" an="" interesting="" r="" package="" you="" have="" found.="" in="" your="" post,="" state:="" (a)="" [1="" point]="" the="" name="" of="" the="" package,="" and="" attach="" a="" link="" to="" its="" technical="" support="" page="" if="" available.="" (b)="" [1="" point]="" introduce="" at="" least="" one="" command="" with="" a="" code="" example.="" you="" may="" base="" your="" answer="" on="" sample="" codes="" that="" come="" with="" the="" technical="" document.="" the="" code="" example="" should="" be="" self-contained,="" that="" if="" another="" person="" copied="" and="" pasted="" your="" code="" chunk="" to="" their="" r-studio="" and="" tried="" it="" out,="" the="" code="" should="" demonstrate="" the="" command="" smoothly.="" (c)="" [0="" points]="" browse="" others’="" entries="" and="" feel="" free="" to="" provide="" some="" feedback!="" any="" package="" is="" a="" fair="" game,="" it="" is="" also="" acceptable="" to="" introduce="" packages="" inside="" tidyverse,="" as="" long="" as="" the="" command="" has="" not="" been="" featured="" in="" this="" course.="" end="" of="" the="" assignment="" remember="" to="" name="" this="" file="" correctly="" and="" submit="" it="" through="" the="" learning="" digital="" platform.="" hia="" 226:="" data=""> 30 4. obese: bmi ≥ 30 call the table “fileone”. then, using fileone, generate a summary table showing the i) average and standard deviation of age and ii) number of cases broken down by the 4 weight categories. order the data in ascending order from underweight to obese category. hia 226: data wrangling hia 226 assignment 06 page 3 of 5 learning monitoring the “learning monitoring” questions mostly concern with learning assessment and course engagement. questions under this category always yield full marks as long as they are answered. the instructor will review them before the next meeting and address any questions. 2. thus far, we have learned a few r packages. for this question, i’d like to invite each of you to make a post on piazza to introduce an interesting r package you have found. in your post, state: (a) [1 point] the name of the package, and attach a link to its technical support page if available. (b) [1 point] introduce at least one command with a code example. you may base your answer on sample codes that come with the technical document. the code example should be self-contained, that if another person copied and pasted your code chunk to their r-studio and tried it out, the code should demonstrate the command smoothly. (c) [0 points] browse others’ entries and feel free to provide some feedback! any package is a fair game, it is also acceptable to introduce packages inside tidyverse, as long as the command has not been featured in this course. end of the assignment remember to name this file correctly and submit it through the learning digital platform. hia 226: data wrangling>