Reference no: EM132249047
Assignment -
Read all questions carefully. All calculations and graphing should be done by using R (no other calculations are accepted). All graphs and tables must have the titles, all graphs should be attractive and have appropriate labels and legends where necessary.
Question 1 -
a. Read (import) the diet data in HW3 folder. [1]
Description of Diet data
Variable Name
|
Description
|
Type
|
SubjNo
|
Subject Number
|
Character
|
RBC
|
Red Blood Cell (in mg per liter)
|
Numeric
|
Diet
|
Diet Group
|
Character (1 = God, 2 = Fair, 3 = Poor)
|
Gender
|
Subject gender
|
Character (0 = male, 1 = female)
|
Race
|
Race group
|
Character (1 = Black, 2 = White, 3 = Hispanic, 4 = Other)
|
Protein
|
Whole-body protein turnover
|
Numeric
|
Ideal Weight
|
Percentage of ideal body weight for height
|
Numeric
|
Age
|
Patient's age in years
|
Numeric
|
HbLevel
|
Mean hemoglobin level in g/dl
|
Numeric
|
b. How many quantitative and qualitative variables are there in the diet data, identify them?
c. Create a descriptive summary table, this table must look similar to the table shown in the lecture - Lecture_descriptivesummaryTable.xls . You must give the title to the table.
d. Identify the possible outliers in HbLevel and RBC count? Just report the number- how many in each.
e. Calculate the CVs for HbLevel and RBC count. Which data do you think will be more consistent and why?
f. Find the quartiles of age? What is the IQR?
Question 2 -
Use the diet data from Q1 and do the followings:
a. Plot a histogram of age? Keep at least 7 intervals (bins). What is the shape of age- right or left skewed or normal?
b. Plot a pie chart of race.
c. Draw bar diagram of diet group. Also create a stacked bar diagram to show the distribution of diet group by race.
d. Make a box plot of RBC? How many outliers are there? What is the shape of RBC - right or left skewed or normal? How do you interpret this shape?
e. Create box plots of patient's age by diet group (one picture should contain all box plots).
f. Make a scatterplot between HbLevel and RBC. Do you suspect any kind of relationship between these two variables? Be specific- such as linear, quadratic etc.
Question 3 -
a. In Q1 c., we created a descriptive summary tables for pooled data. Now, create similar table for both male and female. You can follow the following format (not the exact variable names are shown). [6] Table1: .......
Variable
|
Male
|
Female
|
Mean or Count (%)
|
Standard Deviation (sd)
|
Mean or Count (%)
|
Standard Deviation (sd)
|
n
|
|
|
|
|
A
|
|
|
|
|
B
|
|
|
|
|
Attachment:- Assignment Files.rar