Can anyone teach me what codes
should I use in this question please?
dat used:
Type | Calories | Sodium |
Beef | 186 | 495 |
Beef | 181 | 477 |
Beef | 176 | 425 |
Beef | 149 | 322 |
Beef | 184 | 482 |
Beef | 190 | 587 |
Beef | 158 | 370 |
Beef | 139 | 322 |
Beef | 175 | 479 |
Beef | 148 | 375 |
Beef | 152 | 330 |
Beef | 111 | 300 |
Beef | 141 | 386 |
Beef | 153 | 401 |
Beef | 190 | 645 |
Beef | 157 | 440 |
Beef | 131 | 317 |
Beef | 149 | 319 |
Beef | 135 | 298 |
Beef | 132 | 253 |
Meat | 173 | 458 |
Meat | 191 | 506 |
Meat | 182 | 473 |
Meat | 190 | 545 |
Meat | 172 | 496 |
Meat | 147 | 360 |
Meat | 146 | 387 |
Meat | 139 | 386 |
Meat | 175 | 507 |
Meat | 136 | 393 |
Meat | 179 | 405 |
Meat | 153 | 372 |
Meat | 107 | 144 |
Meat | 195 | 511 |
Meat | 135 | 405 |
Meat | 140 | 428 |
Meat | 138 | 339 |
Poultry | 129 | 430 |
Poultry | 132 | 375 |
Poultry | 102 | 396 |
Poultry | 106 | 383 |
Poultry | 94 | 387 |
Poultry | 102 | 542 |
Poultry | 87 | 359 |
Poultry | 99 | 357 |
Poultry | 107 | 528 |
Poultry | 113 | 513 |
Poultry | 135 | 426 |
Poultry | 142 | 513 |
Poultry | 86 | 358 |
Poultry | 143 | 581 |
Poultry | 152 | 588 |
Poultry | 146 | 522 |
Poultry | 144 | 545 |
Use
sumamry function in R to get the summary and boxplot function in R to get the result
Rcode is:
hotdogs <- read_excel("C:/Users/M1045151/Downloads/hot
dogs.xlsx")
View(hotdogs)
str(hotdogs)
calories <- split(hotdogs$Calories,hotdogs$Type)
print(calories)
sodium <- split(hotdogs$Sodium,hotdogs$Type)
View(calories)
calories$Beef
calories$Meat
calories$Poultry
summary(calories$Beef)
summary(calories$Meat)
summary(calories$Poultry)
summary(sodium$Beef)
summary(sodium$Meat)
summary(sodium$Poultry)
boxplot(hotdogs$Calories~hotdogs$Type,main="Boxplot for hotdogs
interms of calories",
xlab="Type",
ylab="Calories",col=c("gold","darkgreen","orange"))
boxplot(hotdogs$Sodium~hotdogs$Type,main="Boxplot for hotdogs
interms of sodium",
xlab="Type", ylab="Sodium",col=c("gold","green","orange"))
Output:
summary(calories$Beef)
Min. 1st Qu. Median Mean 3rd Qu. Max.
111.0 140.5 152.5 156.8 177.2 190.0
> summary(calories$Meat)
Min. 1st Qu. Median Mean 3rd Qu. Max.
107.0 139.0 153.0 158.7 179.0 195.0
> summary(calories$Poultry)
Min. 1st Qu. Median Mean 3rd Qu. Max.
86.0 102.0 113.0 118.8 142.0 152.0
> summary(sodium$Beef)
Min. 1st Qu. Median Mean 3rd Qu. Max.
253.0 321.2 380.5 401.1 477.5 645.0
> summary(sodium$Meat)
Min. 1st Qu. Median Mean 3rd Qu. Max.
144.0 386.0 405.0 418.5 496.0 545.0
> summary(sodium$Poultry)
Min. 1st Qu. Median Mean 3rd Qu. Max.
357 383 430 459 528 588
Intrepretation:
Calories is highest for the type meat as median=153
sodium is highest for the type poultry as median=459.
From boxplot there are differences in mean calories for the three different types of hotdogs
From boxplot we also observe there is a re differences in mean sodium for the three different types of hotdogs.
Boxplot for hotdogs interms of calories Poultry Beef Meat Type
Boxplot for hotdogs interms of sodium Poultry Beef Meat Type
Can anyone teach me what codes should I use in this question please? The datafile hotdogs.csv...
If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...