logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Tanushri MehtaGeneral article writing
(5/5)

666 Answers

Hire Me
expert
Jason AlexanderHistory
(5/5)

875 Answers

Hire Me
expert
Anmol AroraGeneral article writing
(5/5)

667 Answers

Hire Me
expert
Vishal GoyalComputer science
(5/5)

614 Answers

Hire Me
R Programming
(5/5)

this assignment, you need to use what you’ve learned from this course. You might not receive credits if you use the functions that are not used in this course.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Format:

In order to receive full credit for the practice problems, you need to submit an R script file. All the non-R codes need to be placed after the # signs. You also need to write your name and Assignment 2 on top of the page. Please make sure to include your name as part of the file name. 

To complete this assignment, you need to use what you’ve learned from this course. You might not receive credits if you use the functions that are not used in this course. 

You can only ask questions for clarification purposes on the Discussion Board. That is to say, you can’t ask questions about how to answer a specific question or help you to debug your program.

 Data

You need to load Assignment2.RData to complete this assignment: 

>    load("Assignment2.RData")

>    ls() 

[1]  "chol" "patient"  "sbp"

 Problems 1: 5 points

You will use the data frame, sbp, for this problem.

 >    head(sbp) 

id

visit

sbp

1        125F

1

122

2 13000M

1

NA

3 13120M

1

116

4 13260M

1

122

5 13480M

1

NA

6 13520M

1

132

 This dataset contains SBP (Systolic Blood Pressure) measurements for each patient. Some patients were measured once and some were measured more than once. The description of each variable is described below: 

VARIABLE

DESCRIPTION

id

Patient ID

visit

The visiting time

sbp

Systolic blood pressure

The gender of each patient can be identified from the last field of the ID variable with ‘M’ for Male or ‘F’ for Female. The gender field can be in either upper or lower cases. Some of the IDs start with an ‘x’ and some don’t. For example, ‘x13260M’ and ‘13260M’ refers to the same person.

Write a function, getMaxSBP, that takes one argument, which is the name of the input data.  The function returns a data frame that contains only one observation for each patient with the following variables:

 newID : is created by using the numerical fields of the ID variable. For example, if ID is ‘x13260M’ or ‘13260M’, then NEWID is ‘13260’.

Sex : is created by using the last field of the ID variable, with values, equals ‘M’ or ‘F’ (all in upper cases).

maxsbp : is the maximum SBP for each patient. If an SBP is measured greater than 300, then the SBP value should be considered invalid. In this case, the SBP is considered as the missing value. Some patients might only contain one missing value for this variable.

maxvisit : is the visiting  time that corresponds to the maximum SBP when the patient was measured. For example, consider the following scenarios:

   If a patient was measured three times with

◦  SBP = 120 when visit = 1

◦  SBP = 142 when visit = 2

◦  SBP = 132 when visit = 3

then MAXSBP = 142 and MAXVISIT = 2

If a patient was measured three times with

◦  SBP = 120 when visit = 1

◦  SBP = 305 when visit = 2

◦  SBP = 132 when visit = 3

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme