Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

### Load Libraries library(tidyverse) library(nycflights13) library(lm.beta) R Studio assignment Q1 Analyze the distribution of `departure delays`. Use the space below for your graphical and numerical

### Load Libraries library(tidyverse) library(nycflights13) library(lm.beta)

R Studio assignment

Q1 Analyze the distribution of `departure delays`. Use the space below for your graphical and numerical analysis. Store the summary of this variable in Q1.

Q2 Based on your 0graphical and numerical analysis in Q1, which method -- 1.5(IQR) or 3(SD) -- is more appropriate to remove outliers from the `departure delay` variable? Remove outliers for `departure delay` with the appropriate method. Store this new dataset as `no_out_dd`. You'll want to use this new dataset without outliers for use in Q3. What proportion of rows remains following the removal of these outliers? Store this number as Q2. Do not hardcode the answer. * Note: A boxplot of departure delays in new dataset will still reveal outliers, based on the new five-number summary. For the purpose of this assignment, we will retain these "new" outliers in our dataframe. To completely remove all outliers, we would need to repeat the outlier removal process multiple times. - Your answer should be a number assigned to Q2. Do not round.

Q3 Using the `no_out_dd` dataset you created in Q2, remove outliers for `arrival delay` with the appropriate method. You'll want to create a new dataset without outliers for use in Q4-10. Store this new dataset as `no_out_dd_ad`. Store the dimensions of `no_out_dd_ad` in Q3. Do not hardcode the answer. * Note: A boxplot of `arrival delay` the new dataset will still reveal outliers, based on the new five-number summary. For the purpose of this assignment, we will retain these "new" outliers in our dataframe. To completely remove the new outliers, we would need to repeat the outlier removal process one more time.

Q4 What proportion of rows remain in `no_out_dd_ad` compared to the original `flights` dataset? Store the proportion in Q4. Do not hardcode the answer.

Q5 Using the `no_out_dd_ad` dataframe, run `cor.test` for the relationship between departure delay and arrival delay.

Q6 Using the `no_out_dd_ad` dataframe, create a regression predicting arrival delay from departure delay.

Using the `no_out_dd_ad` dataframe, create another regression, this time adding distance as a predictor to the regression from Q6.

Q8 Using the `no_out_dd_ad` dataframe, calculate standardized regression coefficients with lm.beta for the regression from Q7.

Q9 Using the `no_out_dd_ad` dataframe, create another regression, this time adding carrier as an additional predictor to the regression from Q7. Store the model at `mod1` and the summary to Q9.

Q10 Use the regression model `mod1` from Q9 and the `predict` function to predict the arrival delay, in minutes, for an American Airlines (AA) plane that has 250 miles to its destination and a 30-minute departure delay. Store the prediction in Q10. - The prediction should be assigned to Q10. Do not round. - The `predict()` function requires the regression model and a data frame you create of the predictor variable names and corresponding values. The general structure of predict is `predict(model, data.frame)`. - For examples on how to use the `predict` function, see [here](https://favtutor.com/blogs/predict-function-in-r) or [here](https://www.statology.org/r-lm-predict/)

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

Linear Algebra and Its Applications

Authors: David C. Lay

4th edition

321791541, 978-0321388834, 978-0321791542

More Books

Students also viewed these Mathematics questions

Question

Did the researcher do a confirmability audit?

Answered: 1 week ago

Question

Why is informed consent so important?

Answered: 1 week ago

Question

What are examples of different ways to categorize coping responses?

Answered: 1 week ago