Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

Let X U[0,1]. Find the PDF of Y X2.

Answered: 1 week ago

Question

SQL is used only as Data Manipulation Language ( DML ) .

Answered: 1 week ago