this is in CodeGrade. 2 short quiz in R adapted to CodeGRade nycflights13Stats Assignment Description For this assignment, name your R file nycflights
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →this is in CodeGrade. 2 short quiz in R adapted to CodeGRade
nycflights13Stats Assignment Description
For this assignment, name your R file nycflights13stats.R
For all questions you should load tidyverse, lm.beta, and nycflights13. You should not need to use any other libraries.
If the tidyverse package is not installed, youll need to do a one-time installation from the Console Window in RStudio like this:
install.packages(“tidyverse”)
You cannot attempt to install packages in code that you submit to CodeGrade.
If the nycflights13 package is not installed, youll need to do a one-time installation from the Console Window in RStudio like this:
install.packages(“nycflights13”)
You cannot attempt to install packages in code that you submit to CodeGrade.
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”)
You cannot attempt to install packages in code that you submit to CodeGrade.
Load tidyverse with:
suppressPackageStartupMessages(library(tidyverse))
Load nycflights13 with:
suppressPackageStartupMessages(library(nycflights13))
Load lm.beta with:
suppressPackageStartupMessages(library(lm.beta))
The actual data set is called flights.
See the and for more info.
Continue to use %>% for the pipe. CodeGrade does not support the new pipe.
Round all float/dbl values to two decimal places.
If your rounding does not work the way you expect, convert the tibble to a dataframe by using as.data.frame()
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 questions, please review all CodeGrade information provided in the CodeGrade: Intro module. If you do not, you are likely to lose points.
Address the outliers for departure delay as described in the outliers lectures. Youll want to create a new dataset without outliers for use in Q2-5. What percentage of data remains following the removal of these outliers?
The answer should be assigned to Q1.
Answer the following questions using the new dataset without outliers.
Run cor.test for the relationship between departure delay and distance.
Assign the results of the cor.test() function call to Q2. Do not round.
Create a regression predicting departure delay from distance.
The summary of the model should be assigned to Q3. Do not round.
Note: CodeGrade will be grading you based on the last two lines of the summary output:
Calculate standardized regression coefficients with lm.beta for the regression from Q3.
Assign the results of lm.beta() to Q4. Do not round. Your output should look something like this:
CodeGrade will be grading you on the value in the last column/row.
Create another regression, this time adding carrier as a predictor to the regression from Q3.
The summary of the model should be assigned to Q5. Do not round.
Note: if you use a different method of removing outliers (see Q1) than what is used in the videos you risk upsetting CodeGrade.
Note: CodeGrade will be grading you based on the last two lines of the summary output:
pizzaStats Assignment Description
For this assignment, name your R file pizzaStats.R
For all questions you should load tidyverse and lm.beta. You should not need to use any other libraries.
If the tidyverse package is not installed, youll need to do a one-time installation from the Console Window in RStudio like this:
install.packages(“tidyverse”)
You cannot attempt to install packages in code that you submit to CodeGrade.
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”)
You cannot attempt to install packages in code that you submit to CodeGrade.
Load tidyverse with:
suppressPackageStartupMessages(library(tidyverse))
Load lm.beta with
suppressPackageStartupMessages(library(lm.beta))
Download the pizza.csv file from Brightspace and place it in the same folder/directory as your script file. Then in RStudio, set your Working Directory to your Source File location:
Load the pizza.csv file like this:
pizza % for the pipe. CodeGrade does not support the new pipe.
Round all float/dbl values to two decimal places unless otherwise specified.
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 please review all CodeGrade information provided in the CodeGrade: Intro module. If you do not, you are likely to lose points.
Create a correlation matrix for temperature, bill, pizzas, and got_wine.
Assign the matrix to Q1. It should look something like this:
Create a correlation matrix of the relationships between time, temperature, bill, and pizzas for Laura in the East branch.
Assign the matrix to Q2. It should look something like this:
Run a regression predicting whether or not wine was ordered from temperature, bill, and pizza.
Assign the coefficients of the summary of the model to Q3. It should look something like this:
Run a regression predicting bill from temperature, pizzas, and got_wine.
Assign the standardized regression coefficients to Q4 by using the lm.beta() function. You should not round these values. The output should look something like this:
Note: CodeGrade will be grading you based on the last line (just the values).
Add operator to the regression from Q4. Which is the better model?
Assign the better models AIC to Q5.
Use the classical AIC (k=2).
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds