Reading Data into R

setwd("C:/Users/vaibhav/Desktop/DataSets")
airplane.df<-read.csv("Airlines.csv")
View(airplane.df)

Summarizing data

summary(airplane.df)
##       Airline      Aircraft   FlightDuration   TravelMonth
##  AirFrance: 74   AirBus:151   Min.   : 1.250   Aug:127    
##  British  :175   Boeing:307   1st Qu.: 4.260   Jul: 75    
##  Delta    : 46                Median : 7.790   Oct:127    
##  Jet      : 61                Mean   : 7.578   Sep:129    
##  Singapore: 40                3rd Qu.:10.620              
##  Virgin   : 62                Max.   :14.660              
##       IsInternational  SeatsEconomy    SeatsPremium    PitchEconomy  
##  Domestic     : 40    Min.   : 78.0   Min.   : 8.00   Min.   :30.00  
##  International:418    1st Qu.:133.0   1st Qu.:21.00   1st Qu.:31.00  
##                       Median :185.0   Median :36.00   Median :31.00  
##                       Mean   :202.3   Mean   :33.65   Mean   :31.22  
##                       3rd Qu.:243.0   3rd Qu.:40.00   3rd Qu.:32.00  
##                       Max.   :389.0   Max.   :66.00   Max.   :33.00  
##   PitchPremium    WidthEconomy    WidthPremium    PriceEconomy 
##  Min.   :34.00   Min.   :17.00   Min.   :17.00   Min.   :  65  
##  1st Qu.:38.00   1st Qu.:18.00   1st Qu.:19.00   1st Qu.: 413  
##  Median :38.00   Median :18.00   Median :19.00   Median :1242  
##  Mean   :37.91   Mean   :17.84   Mean   :19.47   Mean   :1327  
##  3rd Qu.:38.00   3rd Qu.:18.00   3rd Qu.:21.00   3rd Qu.:1909  
##  Max.   :40.00   Max.   :19.00   Max.   :21.00   Max.   :3593  
##   PricePremium    PriceRelative      SeatsTotal  PitchDifference 
##  Min.   :  86.0   Min.   :0.0200   Min.   : 98   Min.   : 2.000  
##  1st Qu.: 528.8   1st Qu.:0.1000   1st Qu.:166   1st Qu.: 6.000  
##  Median :1737.0   Median :0.3650   Median :227   Median : 7.000  
##  Mean   :1845.3   Mean   :0.4872   Mean   :236   Mean   : 6.688  
##  3rd Qu.:2989.0   3rd Qu.:0.7400   3rd Qu.:279   3rd Qu.: 7.000  
##  Max.   :7414.0   Max.   :1.8900   Max.   :441   Max.   :10.000  
##  WidthDifference PercentPremiumSeats
##  Min.   :0.000   Min.   : 4.71      
##  1st Qu.:1.000   1st Qu.:12.28      
##  Median :1.000   Median :13.21      
##  Mean   :1.633   Mean   :14.65      
##  3rd Qu.:3.000   3rd Qu.:15.36      
##  Max.   :4.000   Max.   :24.69
library(psych)
describe(airplane.df)
##                     vars   n    mean      sd  median trimmed     mad   min
## Airline*               1 458    3.01    1.65    2.00    2.89    1.48  1.00
## Aircraft*              2 458    1.67    0.47    2.00    1.71    0.00  1.00
## FlightDuration         3 458    7.58    3.54    7.79    7.57    4.81  1.25
## TravelMonth*           4 458    2.56    1.17    3.00    2.58    1.48  1.00
## IsInternational*       5 458    1.91    0.28    2.00    2.00    0.00  1.00
## SeatsEconomy           6 458  202.31   76.37  185.00  194.64   85.99 78.00
## SeatsPremium           7 458   33.65   13.26   36.00   33.35   11.86  8.00
## PitchEconomy           8 458   31.22    0.66   31.00   31.26    0.00 30.00
## PitchPremium           9 458   37.91    1.31   38.00   38.05    0.00 34.00
## WidthEconomy          10 458   17.84    0.56   18.00   17.81    0.00 17.00
## WidthPremium          11 458   19.47    1.10   19.00   19.53    0.00 17.00
## PriceEconomy          12 458 1327.08  988.27 1242.00 1244.40 1159.39 65.00
## PricePremium          13 458 1845.26 1288.14 1737.00 1799.05 1845.84 86.00
## PriceRelative         14 458    0.49    0.45    0.36    0.42    0.41  0.02
## SeatsTotal            15 458  235.96   85.29  227.00  228.73   90.44 98.00
## PitchDifference       16 458    6.69    1.76    7.00    6.76    0.00  2.00
## WidthDifference       17 458    1.63    1.19    1.00    1.53    0.00  0.00
## PercentPremiumSeats   18 458   14.65    4.84   13.21   14.31    2.68  4.71
##                         max   range  skew kurtosis    se
## Airline*               6.00    5.00  0.61    -0.95  0.08
## Aircraft*              2.00    1.00 -0.72    -1.48  0.02
## FlightDuration        14.66   13.41 -0.07    -1.12  0.17
## TravelMonth*           4.00    3.00 -0.14    -1.46  0.05
## IsInternational*       2.00    1.00 -2.91     6.50  0.01
## SeatsEconomy         389.00  311.00  0.72    -0.36  3.57
## SeatsPremium          66.00   58.00  0.23    -0.46  0.62
## PitchEconomy          33.00    3.00 -0.03    -0.35  0.03
## PitchPremium          40.00    6.00 -1.51     3.52  0.06
## WidthEconomy          19.00    2.00 -0.04    -0.08  0.03
## WidthPremium          21.00    4.00 -0.08    -0.31  0.05
## PriceEconomy        3593.00 3528.00  0.51    -0.88 46.18
## PricePremium        7414.00 7328.00  0.50     0.43 60.19
## PriceRelative          1.89    1.87  1.17     0.72  0.02
## SeatsTotal           441.00  343.00  0.70    -0.53  3.99
## PitchDifference       10.00    8.00 -0.54     1.78  0.08
## WidthDifference        4.00    4.00  0.84    -0.53  0.06
## PercentPremiumSeats   24.69   19.98  0.71     0.28  0.23

I have distributed the list of all factors affecting price of Economy and Premium Economy tickets in two parts: Part 1: Factors involving general terms 1)Airline 2)Aircraft 3)Month 4)Duration 5)IsInternational Part 2: Seat’s effect on price 1)Availability of seats 2)Pitch Difference 3)Width Difference

Drawing BoxPlots of Part 1 factors

par(mfrow=c(2,2))
boxplot(airplane.df$PriceRelative ~ airplane.df$Airline,horizontal= TRUE,las=1)
boxplot(airplane.df$PriceRelative ~ airplane.df$Aircraft,horizontal= TRUE,las=1)
boxplot(airplane.df$PriceRelative ~ airplane.df$TravelMonth,horizontal= TRUE,las=1)
boxplot(airplane.df$PriceRelative ~ airplane.df$IsInternational,horizontal= TRUE,las=1)

par(mfrow=c(1,1))
plot(x=airplane.df$PriceRelative,y=airplane.df$FlightDuration,log="xy",main="Price VS Duration")

Drawing BoxPlots of Part 2 factors

par(mfrow=c(1,3))
boxplot(airplane.df$PriceRelative ~ airplane.df$PitchDifference,horizontal= TRUE,las=1)
boxplot(airplane.df$PriceRelative ~ airplane.df$WidthDifference,horizontal= TRUE,las=1)
plot(x=airplane.df$PriceRelative,y=airplane.df$PercentPremiumSeats,horizontal= TRUE,las=1)
## Warning in plot.window(...): "horizontal" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "horizontal" is not a graphical
## parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "horizontal"
## is not a graphical parameter

## Warning in axis(side = side, at = at, labels = labels, ...): "horizontal"
## is not a graphical parameter
## Warning in box(...): "horizontal" is not a graphical parameter
## Warning in title(...): "horizontal" is not a graphical parameter

par(mfrow=c(1,1))
airline<- subset(airplane.df,,select = c(FlightDuration,SeatsEconomy,SeatsPremium,PitchEconomy,PitchPremium,WidthEconomy,WidthPremium,PriceEconomy,PricePremium,PriceRelative,SeatsTotal,PitchDifference,WidthDifference,PercentPremiumSeats))
cov(airline)
##                     FlightDuration  SeatsEconomy  SeatsPremium
## FlightDuration          12.5462183    52.9194291    7.57372426
## SeatsEconomy            52.9194291  5832.9154300  633.07060954
## SeatsPremium             7.5737243   633.0706095  175.86521648
## PitchEconomy             0.6817421     7.2117665   -0.29725856
## PitchPremium             0.4477835    11.9637325    0.08508595
## WidthEconomy             0.9014224    15.9105138    3.36977440
## WidthPremium             0.4019845     8.5832800   -0.03954019
## PriceEconomy          1983.5401655  9673.7944684 1489.38359627
## PricePremium          2959.9783043 17413.2541733 3717.36428960
## PriceRelative            0.1932368     0.1361699   -0.58078765
## SeatsTotal              60.4931534  6465.9860396  808.93582602
## PitchDifference         -0.2339587     4.7519660    0.38234451
## WidthDifference         -0.4994380    -7.3272338   -3.40931459
## PercentPremiumSeats      1.0379912  -122.3914537   31.14753127
##                     PitchEconomy PitchPremium WidthEconomy WidthPremium
## FlightDuration         0.6817421   0.44778348   0.90142242   0.40198446
## SeatsEconomy           7.2117665  11.96373253  15.91051379   8.58327998
## SeatsPremium          -0.2972586   0.08508595   3.36977440  -0.03954019
## PitchEconomy           0.4292471  -0.47398546   0.10756500  -0.38766208
## PitchPremium          -0.4739855   1.72639580  -0.01739081   1.08157435
## WidthEconomy           0.1075650  -0.01739081   0.31081765   0.05010845
## WidthPremium          -0.3876621   1.08157435   0.05010845   1.20378776
## PriceEconomy         238.7031905  65.42513354  37.46095191 -61.85450011
## PricePremium         190.8517195 149.85356368 108.11611707  90.47997668
## PriceRelative         -0.1248808   0.24719874  -0.01104335   0.24928593
## SeatsTotal             6.9145079  12.04881848  19.28028819   8.54373979
## PitchDifference       -0.9032326   2.20038126  -0.12495581   1.46923643
## WidthDifference       -0.4952271   1.09896515  -0.26070920   1.15367930
## PercentPremiumSeats   -0.3261739  -1.11655834   0.61321816  -0.97393787
##                      PriceEconomy  PricePremium PriceRelative
## FlightDuration         1983.54017    2959.97830    0.19323683
## SeatsEconomy           9673.79447   17413.25417    0.13616991
## SeatsPremium           1489.38360    3717.36429   -0.58078765
## PitchEconomy            238.70319     190.85172   -0.12488080
## PitchPremium             65.42513     149.85356    0.24719874
## WidthEconomy             37.46095     108.11612   -0.01104335
## WidthPremium            -61.85450      90.47998    0.24928593
## PriceEconomy         976684.06198 1147494.76801 -128.49991725
## PricePremium        1147494.76801 1659293.11947   18.48428836
## PriceRelative          -128.49992      18.48429    0.20302893
## SeatsTotal            11163.17806   21130.61846   -0.44461774
## PitchDifference        -173.27806     -40.99816    0.37207954
## WidthDifference         -99.31545     -17.63614    0.26032928
## PercentPremiumSeats     312.61077     726.01582   -0.35252750
##                        SeatsTotal PitchDifference WidthDifference
## FlightDuration         60.4931534      -0.2339587      -0.4994380
## SeatsEconomy         6465.9860396       4.7519660      -7.3272338
## SeatsPremium          808.9358260       0.3823445      -3.4093146
## PitchEconomy            6.9145079      -0.9032326      -0.4952271
## PitchPremium           12.0488185       2.2003813       1.0989652
## WidthEconomy           19.2802882      -0.1249558      -0.2607092
## WidthPremium            8.5437398       1.4692364       1.1536793
## PriceEconomy        11163.1780647    -173.2780570     -99.3154520
## PricePremium        21130.6184629     -40.9981558     -17.6361404
## PriceRelative          -0.4446177       0.3720795       0.2603293
## SeatsTotal           7274.9218656       5.1343105     -10.7365484
## PitchDifference         5.1343105       3.1036138       1.5941922
## WidthDifference       -10.7365484       1.5941922       1.4143885
## PercentPremiumSeats   -91.2439224      -0.7903844      -1.5871560
##                     PercentPremiumSeats
## FlightDuration                1.0379912
## SeatsEconomy               -122.3914537
## SeatsPremium                 31.1475313
## PitchEconomy                 -0.3261739
## PitchPremium                 -1.1165583
## WidthEconomy                  0.6132182
## WidthPremium                 -0.9739379
## PriceEconomy                312.6107669
## PricePremium                726.0158229
## PriceRelative                -0.3525275
## SeatsTotal                  -91.2439224
## PitchDifference              -0.7903844
## WidthDifference              -1.5871560
## PercentPremiumSeats          23.4493343

Visulaizing Correlation

library(corrgram)
corrgram(airplane.df,order=TRUE,lower.panel = panel.shade,upper.panel = panel.pie,text.panel = panel.txt,main="Corrgram of airlines intercorrelations")

Seeing Average Relative Prizes in accordance with part 1:

aggregate(airplane.df$PriceRelative,list(airplane.df$Airline,airplane.df$TravelMonth,airplane.df$IsInternational,airplane.df$Aircraft),mean)
##      Group.1 Group.2       Group.3 Group.4          x
## 1      Delta     Oct      Domestic  AirBus 0.05666667
## 2      Delta     Sep      Domestic  AirBus 0.07333333
## 3  AirFrance     Aug International  AirBus 0.12444444
## 4    British     Aug International  AirBus 0.26692308
## 5      Delta     Aug International  AirBus 0.42000000
## 6        Jet     Aug International  AirBus 0.67000000
## 7  Singapore     Aug International  AirBus 0.80000000
## 8     Virgin     Aug International  AirBus 0.59222222
## 9  AirFrance     Jul International  AirBus 0.04666667
## 10   British     Jul International  AirBus 0.33333333
## 11       Jet     Jul International  AirBus 0.82000000
## 12 Singapore     Jul International  AirBus 0.80000000
## 13    Virgin     Jul International  AirBus 0.60500000
## 14 AirFrance     Oct International  AirBus 0.35111111
## 15   British     Oct International  AirBus 0.36071429
## 16     Delta     Oct International  AirBus 0.42000000
## 17       Jet     Oct International  AirBus 0.96000000
## 18 Singapore     Oct International  AirBus 0.80000000
## 19    Virgin     Oct International  AirBus 0.57142857
## 20 AirFrance     Sep International  AirBus 0.24416667
## 21   British     Sep International  AirBus 0.33357143
## 22     Delta     Sep International  AirBus 0.34000000
## 23       Jet     Sep International  AirBus 0.41000000
## 24 Singapore     Sep International  AirBus 0.80000000
## 25    Virgin     Sep International  AirBus 0.59222222
## 26     Delta     Aug      Domestic  Boeing 0.08800000
## 27     Delta     Jul      Domestic  Boeing 0.06400000
## 28     Delta     Oct      Domestic  Boeing 0.10250000
## 29     Delta     Sep      Domestic  Boeing 0.11000000
## 30 AirFrance     Aug International  Boeing 0.20000000
## 31   British     Aug International  Boeing 0.48282051
## 32       Jet     Aug International  Boeing 0.98428571
## 33 Singapore     Aug International  Boeing 0.37714286
## 34    Virgin     Aug International  Boeing 0.98571429
## 35 AirFrance     Jul International  Boeing 0.12500000
## 36   British     Jul International  Boeing 0.45400000
## 37       Jet     Jul International  Boeing 0.91642857
## 38 Singapore     Jul International  Boeing 0.37750000
## 39    Virgin     Jul International  Boeing 0.99833333
## 40 AirFrance     Oct International  Boeing 0.21636364
## 41   British     Oct International  Boeing 0.51717949
## 42       Jet     Oct International  Boeing 1.10615385
## 43 Singapore     Oct International  Boeing 0.31333333
## 44    Virgin     Oct International  Boeing 0.90777778
## 45 AirFrance     Sep International  Boeing 0.23300000
## 46   British     Sep International  Boeing 0.44600000
## 47       Jet     Sep International  Boeing 0.87923077
## 48 Singapore     Sep International  Boeing 0.33714286
## 49    Virgin     Sep International  Boeing 0.94285714

Seeing Average Relative prizes in accordance with part 2:

aggregate(airplane.df$PriceRelative,list(airplane.df$PitchDifference,airplane.df$WidthDifference,airplane.df$PercentPremiumSeats),mean)
##    Group.1 Group.2 Group.3          x
## 1       10       4    4.71 0.95263158
## 2        6       1    8.90 0.20928571
## 3        6       1    9.76 0.80000000
## 4        6       2   10.00 1.32000000
## 5        7       1   10.57 0.60416667
## 6       10       4   11.43 1.15370370
## 7        6       2   12.12 0.03000000
## 8        6       2   12.28 0.08590909
## 9        2       0   12.50 0.10230769
## 10       6       1   12.50 0.27914286
## 11       2       0   12.82 0.07200000
## 12       7       1   12.90 0.50414634
## 13       2       0   13.04 0.06200000
## 14       3       0   13.13 0.10750000
## 15       6       1   13.21 0.34958333
## 16       7       3   14.02 0.61111111
## 17       3       0   14.50 0.09500000
## 18       7       3   14.97 0.74000000
## 19       7       1   14.99 0.31000000
## 20       7       3   15.02 1.03523810
## 21       7       1   15.36 0.32211538
## 22       2       0   16.46 0.09000000
## 23      10       4   16.87 0.39625000
## 24       7       1   18.73 0.73500000
## 25       3       0   20.41 0.06125000
## 26       7       3   20.60 0.44666667
## 27       7       1   23.49 0.41600000
## 28       7       1   24.69 0.42254902

Hypothesis 1: The price of premium seats is greatly affected by the duration of the flight,the total number of seats,the number of premium seats,the difference in the width of the premium seats and the difference in the pitch of the premium seats.

library(psych)
t.test(airplane.df$PricePremium,airplane.df$FlightDuration,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PricePremium and airplane.df$FlightDuration
## t = 30.585, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1719.606 1955.754
## sample estimates:
## mean of the differences 
##                 1837.68
t.test(airplane.df$PricePremium,airplane.df$SeatsPremium,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PricePremium and airplane.df$SeatsPremium
## t = 30.164, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1693.583 1929.635
## sample estimates:
## mean of the differences 
##                1811.609
t.test(airplane.df$PricePremium,airplane.df$SeatsTotal,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PricePremium and airplane.df$SeatsTotal
## t = 27.023, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1492.266 1726.328
## sample estimates:
## mean of the differences 
##                1609.297
t.test(airplane.df$PricePremium,airplane.df$WidthDifference,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PricePremium and airplane.df$WidthDifference
## t = 30.629, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1725.338 1961.910
## sample estimates:
## mean of the differences 
##                1843.624
t.test(airplane.df$PricePremium,airplane.df$PitchDifference,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PricePremium and airplane.df$PitchDifference
## t = 30.545, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1720.282 1956.858
## sample estimates:
## mean of the differences 
##                 1838.57

Hypothesis 2: The relative price difference is greatly affected by the duration of the flight,the total number of seats,the difference in the pitch of economy and premium seats and the difference in the width of economy and premium seats

t.test(airplane.df$PriceRelative,airplane.df$FlightDuration,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PriceRelative and airplane.df$FlightDuration
## t = -43.158, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.413501 -6.767765
## sample estimates:
## mean of the differences 
##               -7.090633
t.test(airplane.df$PriceRelative,airplane.df$SeatsTotal,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PriceRelative and airplane.df$SeatsTotal
## t = -59.078, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -243.3062 -227.6408
## sample estimates:
## mean of the differences 
##               -235.4735
t.test(airplane.df$PriceRelative,airplane.df$PitchDifference,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PriceRelative and airplane.df$PitchDifference
## t = -82.896, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -6.347561 -6.053574
## sample estimates:
## mean of the differences 
##               -6.200568
t.test(airplane.df$PriceRelative,airplane.df$WidthDifference,paired = TRUE)
## 
##  Paired t-test
## 
## data:  airplane.df$PriceRelative and airplane.df$WidthDifference
## t = -23.418, df = 457, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -1.242149 -1.049816
## sample estimates:
## mean of the differences 
##               -1.145983

From the testing of Hypothesis 1 we can say that the hypothesis cannot be considered null and all the factors affect the price of premium seats

final<-lm(PricePremium~FlightDuration+SeatsTotal+SeatsPremium+WidthDifference+PitchDifference,data = airplane.df)
summary(final)
## 
## Call:
## lm(formula = PricePremium ~ FlightDuration + SeatsTotal + SeatsPremium + 
##     WidthDifference + PitchDifference, data = airplane.df)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2273.0  -605.0   -19.5   701.9  4485.5 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       20.3415   238.4197   0.085  0.93205    
## FlightDuration   235.6225    12.9664  18.172  < 2e-16 ***
## SeatsTotal        -0.8036     0.7592  -1.058  0.29041    
## SeatsPremium      19.9846     5.0617   3.948 9.13e-05 ***
## WidthDifference  258.7604    62.3947   4.147 4.02e-05 ***
## PitchDifference -129.4945    40.8960  -3.166  0.00165 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 955.9 on 452 degrees of freedom
## Multiple R-squared:  0.4553, Adjusted R-squared:  0.4493 
## F-statistic: 75.57 on 5 and 452 DF,  p-value: < 2.2e-16

we can therefore generate a formula to calculate approximately the price of premium seats. PricePremium = 20.3415+235.6225FlightDuration + 19.9846SeatsPremium + 258.7604WidthDifference -129.4945PitchDifference.

From the testing of Hypothesis 1 we can say that the hypothesis cannot be considered null and all the factors affect the relative pricing of the seats.

final1<-lm(PriceRelative~FlightDuration+SeatsTotal+PitchDifference+WidthDifference, data = airplane.df)
summary(final1)
## 
## Call:
## lm(formula = PriceRelative ~ FlightDuration + SeatsTotal + PitchDifference + 
##     WidthDifference, data = airplane.df)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.7518 -0.2876 -0.0572  0.1593  1.1593 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -2.403e-01  9.510e-02  -2.527 0.011854 *  
## FlightDuration   2.200e-02  5.180e-03   4.247 2.63e-05 ***
## SeatsTotal      -9.444e-05  2.176e-04  -0.434 0.664447    
## PitchDifference  5.590e-02  1.590e-02   3.515 0.000483 ***
## WidthDifference  1.281e-01  2.377e-02   5.390 1.14e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3819 on 453 degrees of freedom
## Multiple R-squared:  0.2878, Adjusted R-squared:  0.2816 
## F-statistic: 45.77 on 4 and 453 DF,  p-value: < 2.2e-16

we can therefore generate a formula to calculate approximately the relative price similarly. Generating an overall sense of effect on prizes comprising both Part 1 and Part 2 factors

finallm<-lm(PriceRelative~FlightDuration+SeatsTotal+PitchDifference+WidthDifference+FlightDuration+SeatsTotal+SeatsPremium+WidthDifference+PitchDifference, data = airplane.df)
summary(finallm)
## 
## Call:
## lm(formula = PriceRelative ~ FlightDuration + SeatsTotal + PitchDifference + 
##     WidthDifference + FlightDuration + SeatsTotal + SeatsPremium + 
##     WidthDifference + PitchDifference, data = airplane.df)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.80484 -0.29867 -0.04187  0.15303  1.13496 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -0.2313245  0.0950846  -2.433 0.015368 *  
## FlightDuration   0.0219549  0.0051712   4.246 2.65e-05 ***
## SeatsTotal       0.0002479  0.0003028   0.819 0.413376    
## PitchDifference  0.0619855  0.0163098   3.801 0.000164 ***
## WidthDifference  0.1159313  0.0248838   4.659 4.19e-06 ***
## SeatsPremium    -0.0032755  0.0020187  -1.623 0.105369    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3812 on 452 degrees of freedom
## Multiple R-squared:  0.292,  Adjusted R-squared:  0.2841 
## F-statistic: 37.28 on 5 and 452 DF,  p-value: < 2.2e-16