Question: Answer all the question including how we would classify the variable please!! INSTRUCTIONS You will need to use R to answer this question. You must

Answer all the question including how we would classify the variable please!! INSTRUCTIONS
You will need to use R to answer this question.
You must submit a single pdf file containing your complete solutions including the R code and output.
Solutions need not be typed (although they can be) but handwritten solutions will need to be scanned
to a pdf file which must be readable.
Question 1
You will work with the NHANES dataset.
Task 1: Load the NHANES package and the NHANES dataset in your workspace. (1)
Task 2: Remove the duplicate cases from the dataframe and store the new dataframe in another object. I
am calling it df here. (1)
Use the code below for this task:
#Extract the unique IDs
df - NHANES[!duplicated(NHANES$ID),]
Task 3: Inspect the HHIncome variable!
How would you classify the variable
(i) based on its characteristic - Quantitative or Qualitative?
(ii) based on how R interprets it?
(iii) based on scales of measurement? (3)
How many categories are there in the variable? (1)
Calculate the frequency table and report the category with highest frequency (modal category).(2)
To display the variable, we can use a Barplot. In R, the barplot() function can be used to create it.
Use the code below to create the plot. (2)HHI_bp - barplot(freq_table, horiz = TRUE, yaxt='n')axis(2, at=HHI_bp, labels=levels(df$HHIncome), las =1)Provide a suitable title using the main parameter and labels for x-axis and y-axis using xlab and ylab
parameter. (3)
Task 4: Inspect the BMI variable!
How would you classify the variable
(i) based on its characteristic - Quantitative or Qualitative?
(ii) based on how R interprets it?
(iii) based on scales of measurement? (3)
Construct three histograms with 10,50 and 100 breaks. Make the y-axis of these histograms density.
You will need to use the parameter probability. Provide a suitable title for each plot (write how
many breaks) and label the x-axis. (5)
Comment on the shape of the histogram. (2)
Compute the sample mean and the sample standard deviation. Watchout for the missing values!
R uses NA to code the missing observations. (2)
 Answer all the question including how we would classify the variable

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!