Part II creating customized descriptive statistics
5) Which routes are the frequently flown routes in the dataset? A route is defined as a unique combination of the origin city and destination city. Display the top 10 frequently flown routes in the dataset, including their origin city, destination city and the frequency of flights. [Please answer Question 7 in the Answer Sheet]
6) Create a table to display the total number of flights, the number of canceled flights and percentage of canceled flights, average departure delay, and average arrival delay for each carrier and each month. (One pipeline only)[hint: you can name your own generated variables, the same rule applies to all other questions, unless a specified name is required]
7) Are distance, arr_delay and dep_delay correlated? In one pipeline, display the correlation table [please answer Question 8 in the Answer Sheet]
8) Are the monthly percentage of canceled flights and the monthly average departure delay of different carriers highly correlated? Your result should display the correlation number. (one pipeline only) [hint: you need to create a summary table that contains the data for the montly percentage of canceled flights and the monthly average departure delay before you calculate the correlation] [please answer question 9 in the Answer Sheet]
9) Create two histograms for the "distance" variable for carriers "American Airlines" and "Spirit Airlines", respectively. Canceled flights should be excluded. Please arrange the two histograms in two rows. [Please answer Question 10 in the Answer Sheet]
10) Create a summary table of the mean values of the following variable: arr_deplay, dep_delay, distance, tax_in, tax_out. Manipulate your table so that your table contains two columns. The first column displays all the variable names you just created, and the second column contains all the mean values, with the mean values sorted in descending order. [hint: you need to use pivot_longer() function to reshape your result table]
After you finish this part, please answer the questions from Q7-10 in the Answer Sheet.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.