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...

1 answer below »
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="">
Answered 1 days AfterJun 24, 2022

Answer To: HIA 226 Assignment 06 Read the following instructions carefully 1. The full mark of this test is 6...

Subhanbasha answered on Jun 25 2022
73 Votes
Answers
Question1:
    Here we are going to do the all the question using R studio where we have learned so far about to code in the R
studio.
Here I have used the package dplyr which is powerful package of data wrangling and manipulation in all the scenarios.
We have to install the package first in the R studio as to do data manipulation steps as required. The following is the code for installing the package and calling the package in R.
# installing required package
install.packages('dplyr')
# calling required package
library(dplyr)
a).
Ans: First we are going to read the data file into R by using the command as follows
# Reading the data file into R
Phys_data <- read.csv('phys.csv',skip = 2)
For creating the table of the required condition first we are going to filter the data by using the following command.
# Filtering data of age between 60 and 70
Phys_data_60_70 <- Phys_data %>% filter(age>60 & age<70)
Then in the next step we are going to select the required column in the table and finally we are going to print the table by using the following command.
# Selecting required columns that are systolic.bp and diastolic.bp
Phys_data_60_70 <- Phys_data_60_70 %>% select(c(systolic.bp,diastolic.bp))
# Printing the table
print(Phys_data_60_70)
b).
Ans: In this requirement first, we are going...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here