Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

### Q 1 Create a correlation matrix for the relations between calories, total _ fat, sugar, and calcium for all items at Sonic, Subway, and

### Q1 Create a correlation matrix for the relations between calories, total_fat, sugar, and calcium for all items at Sonic, Subway, and Taco Bell, omitting missing values with `na.omit()`.
- Assign the matrix to Q1. It should look something like this:
```
calories total_fat sugar calcium
calories [value][value][value][value]
total_fat [value][value][value][value]
sugar [value][value][value][value]
calcium [value][value][value][value]
### Q2 Create a regression predicting whether or not a restaurant is McDonalds or Subway based on calories, sodium, and protein. (McDonalds should be 1, Subway 0) Hint: make sure you know how McDonalds is spelled in the dataset.
- Assign the model coefficients to Q2. Your output should look something like this:
```
(Intercept) calories sodium protein
[value][value][value][value]
### Q3 Run the same regression as in Q2 but remove sodium as a predictor. Which is the better model?
- Use the classical AIC (k=2).
Assign the AIC of the better model to Q3.
### Q4 Run a regression predicting calories from saturated fat, fiber, and sugar. Based on *standardized* regression coefficients, identify the strongest predictor.
- Assign the ***un**standardized* regression coefficient of the strongest predictor to Q4.
-(You can access the coefficients by indexing the model object.)
### Q5 For this question, use data from only restaurants with between 50 and 60 items in the data set. Predict total fat from cholesterol, total carbs, vitamin a, and restaurant. Remove any nonsignificant predictors and run again.
- Assign the strongest standardized regression coefficient to Q5. Your output should look something like this:
```
[variable name]
[value]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions