Question: Need to code for this practice assignment all the code needs to be assigned as per the directions. its going in code grade so Q

Need to code for this practice assignment all the code needs to be assigned as per the directions. its going in code grade so Q1 needs to be assigned to Q1 the Q2 assigned to Q2 and so on thank you. fastfoodStats For this assignment, name your R file fastfoodStats.R For all questions you should load tidyverse, lm.beta and openintro. You should not need to use any other libraries. If the openintro package is not installed, youll need to do a one-time installation from the Console Window in RStudio like this: install.packages("openintro") If the lm.beta package is not installed, youll need to do a one-time installation from the Console Window in RStudio like this: install.packages("lm.beta") Load libraries with suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(lm.beta)) suppressPackageStartupMessages(library(openintro)) Round all float/dbl values to two decimal places. All statistics should be run with variables in the order I state E.g.,Run a regression predicting mileage from mpg, make, and type would be: lm(mileage ~ mpg + make + type...) Before attempting to answer these, or if you lose points upon an attempt, please review all CodeGrade information provided in the CodeGrade overview submodule - if you do not you are likely to lose points. To access the fastfood data, run the following: fastfood <- openintro::fastfood 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 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) Save the coefficients to Q2 Run the same regression as in #2 but remove sodium as a predictor. Which model fits better? Save the AIC of the better model to Q3. Run a regression predicting calories from saturated fat, fiber, and sugar. Based on standardized regression coefficients, identify the strongest predictor. Assign the unstandardized regression coefficient of the strongest predictor to Q4.(You can access the coefficients by indexing the model object) 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.

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!