Assignment 4 Week 5

In order to tidy and transforming the given dataset a csv file was created using all the information with a wide structure.The CSV file is stored in GitHub.

[link] (https://github.com/maliat-hossain/Air-lane-Data-607)

## Warning: package 'wesanderson' was built under R version 4.0.4

csv file:

##        X     X.1 Los.Angeles Phoenix San.Diego San.Francisco Seattle
## 1 Alaska On Time         497     221       212           503    1841
## 2        Delayed          62      12        20           102     305
## 3                         NA      NA        NA            NA      NA
## 4 AmWest On Time         694    4840       383           320     201
## 5        Delayed         117     415        65           129      61

Column names are added to first columns.Empty cells were filled with the needed value.

Table 1:Flight Information Table
airline status Los.Angeles Phoenix San.Diego San.Francisco Seattle
Alaska On Time 497 221 212 503 1841
Alaska Delayed 62 12 20 102 305
NA NA NA NA NA
AmWest On Time 694 4840 383 320 201
AmWest Delayed 117 415 65 129 61

Airline data has been converted to numeric data to perform analysis,unnecessary punctuation marks were removed to make data more accessible for analysis.

Table 2:Flight Information Preparation for Analysis
airline status city number.airlines
Alaska On Time Los Angeles 497
Alaska Delayed Los Angeles 62
AmWest On Time Los Angeles 694
AmWest Delayed Los Angeles 117
Alaska On Time Phoenix 221
Alaska Delayed Phoenix 12
AmWest On Time Phoenix 4840
AmWest Delayed Phoenix 415
Alaska On Time San Diego 212
Alaska Delayed San Diego 20
AmWest On Time San Diego 383
AmWest Delayed San Diego 65
Alaska On Time San Francisco 503
Alaska Delayed San Francisco 102
AmWest On Time San Francisco 320
AmWest Delayed San Francisco 129
Alaska On Time Seattle 1841
Alaska Delayed Seattle 305
AmWest On Time Seattle 201
AmWest Delayed Seattle 61

The rate of On Time and Delayed flights are calculated. The comparison of the rate of delay and on time flights bteween two airlines is necessary to quantify their performances.

## `summarise()` regrouping output by 'airline' (override with `.groups` argument)
Table 3:Flight Information Scenario
airline status city number.airlines rate.status
Alaska On Time Los Angeles 497 0.889
Alaska Delayed Los Angeles 62 0.111
AmWest On Time Los Angeles 694 0.856
AmWest Delayed Los Angeles 117 0.144
Alaska On Time Phoenix 221 0.948
Alaska Delayed Phoenix 12 0.052
AmWest On Time Phoenix 4840 0.921
AmWest Delayed Phoenix 415 0.079
Alaska On Time San Diego 212 0.914
Alaska Delayed San Diego 20 0.086
AmWest On Time San Diego 383 0.855
AmWest Delayed San Diego 65 0.145
Alaska On Time San Francisco 503 0.831
Alaska Delayed San Francisco 102 0.169
AmWest On Time San Francisco 320 0.713
AmWest Delayed San Francisco 129 0.287
Alaska On Time Seattle 1841 0.858
Alaska Delayed Seattle 305 0.142
AmWest On Time Seattle 201 0.767
AmWest Delayed Seattle 61 0.233

On time flights are extracted

Table 4:Flight Information Scenario with On Time Flights
airline status city number.airlines rate.status
Alaska On Time Los Angeles 497 0.889
AmWest On Time Los Angeles 694 0.856
Alaska On Time Phoenix 221 0.948
AmWest On Time Phoenix 4840 0.921
Alaska On Time San Diego 212 0.914
AmWest On Time San Diego 383 0.855
Alaska On Time San Francisco 503 0.831
AmWest On Time San Francisco 320 0.713
Alaska On Time Seattle 1841 0.858
AmWest On Time Seattle 201 0.767

The plot and rate refers that Alaska is performing better than Amwest Airlines. Amwest has a significantly higher delay rate. However the time of the data collected is not disclosed. It can be further analyzed if Amwest delayed its flight on the same day when Alaska airlines flights were on time. Weather can be an attribute to the delay of Amwest’s flights. The date needs to be added to understand the data better. However,with the present data it can be referred that technical difficulties such as issues in their engine, or unskilled crews may cause the delay to Amwest Flights. In terms of City Amwest Airlines did not perform well in San Francisco compared to Alaska Airlines.