QuestionQuestion

One of the responsibilities of United States Department of Agriculture (USDA) is to execute the federal laws related to food. In their website they have a detailed database of different types of food and their nutrients. You can download a small version of their database in the attachment. In this dataset, you'll find different types of food and the amount of calories in 100 grams of them as well as amount of different nutrients such as total fat, sugar, iron and so on.

Read this dataset into the R, summarize the data using the methods you have learned and answer these questions:

1 - Which column has the most missing values?

2 - Do you see any relationship between any two types of nutrients in different foods? If yes, which ones? support your hypothesis by visualizing the necessary portion of the data that helps you.

3 - Do you find any relationship between the amount of calories in a food and any other nutrient? Explain and visualize

4 - Do you observe any other trend in the data? Explain

Please submit your answers in a word file and make sure that you include all the functions you have used. If the functions are not included, 50% of the grade will be lost.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

# Reading the CSV file using base R Function
USDAData<-read.csv("path/gtrU6OP5tzjZ7owE8Rdw.csv")

# Now that we have the data into R Environment let's look at the dimentions of the data
dim(USDAData)
## [1] 7058   16
# We can see that we have 16 Variables in our dataset and 7058 observations

# Now we will have a glimpse of the structure of the data
str(USDAData)
## 'data.frame':    7058 obs. of 16 variables:
## $ ID          : int 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 ...
## $ Description : Factor w/ 7054 levels "ABALONE,MIXED SPECIES,RAW",..: 1303 1302 1298 2303 2304 2305 2306 2307 2308 2309 ...
## $ Calories    : int 717 717 876 353 371 334 300 376 403 387 ...
## $ Protein    : num 0.85 0.85 0.28 21.4 23.24 ...
## $ TotalFat    : num 81.1 81.1 99.5 28.7 29.7 ...
## $ Carbohydrate: num 0.06 0.06 0 2.34 2.79 0.45 0.46 3.06 1.28 4.78 ...
## $ Sodium      : int 714 827 2 1395 560 629 842 690 621 700 ...
## $ SaturatedFat: num 51.4 50.5 61.9 18.7 18.8 ...
## $ Cholesterol : int 215 219 256 75 94 100 72 93 105 103 ...
## $ Sugar       : num 0.06 0.06 0 0.5 0.51 0.45 0.46 NA 0.52 NA ...
## $ Calcium    : int 24 24 4 528 674 184 388 673 721 643 ...
## $ Iron       : num 0.02 0.16 0 0.31 0.43 0.5 0.33 0.64 0.68 0.21 ...
## $ Potassium   : int 24 26 5 256 136 152 187 93 98 95 ...
## $ VitaminC    : num 0 0 0 0 0 0 0 0 0 0 ...
## $ VitaminE    : num 2.32 2.32 2.8 0.25 0.26 0.24 0.21 NA 0.29 NA ...
## $ VitaminD    : num 1.5 1.5 1.8 0.5 0.5 0.5 0.4 NA 0.6 NA ...
# From the above output we can see that only one variable is categorical i.e. Description resta ll are numeric

# 1.
# To see which column have maximum NA value, and other descriptives we will look at the summary
summary(USDAData)
##       ID      
## Min.   : 1001
## 1st Qu.: 8387
## Median :13294
## Mean   :14260
## 3rd Qu.:18337
## Max.   :93600...

By purchasing this solution you'll be able to access the following files:
Solution.docx and Solution.R.

$35.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Advanced Statistics Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats