This project was done to study the factors affecting the difference of price in Premium Economy and Economy seats in Airline.
SixAirline <- read.csv(paste("SixAirlinesDataV2.csv", sep="")) View(SixAirline)
summary(SixAirline)
boxplot(SixAirline$PriceEconomy ~ SixAirline$Airline, data=SixAirline, horizontal=TRUE, yaxt="n", ylab="Airline", xlab="PriceEconomy", main="Comparison of Price in different Airlines") axis(side=2, at=c(1,2,3,4,5,6), labels=c("AirFrance", "British "," Delta","Jet","Singapore","Virgin"))
boxplot(SixAirline$PricePremium ~ SixAirline$Airline, data=SixAirline, horizontal=TRUE, yaxt="n", ylab="Airline", xlab="PricePremium", main="Comparison of Price in different Airlines") axis(side=2, at=c(1,2,3,4,5,6), labels=c("AirFrance", "British "," Delta","Jet","Singapore","Virgin"))
seate.mean <- aggregate(PitchEconomy ~ Airline, data=SixAirline, mean)
seatp.mean <- aggregate(PitchPremium ~ Airline, data=SixAirline, mean)
seate.mean <- aggregate(PitchEconomy ~ Airline, data=SixAirline, mean)
seatp.mean <- aggregate(PitchPremium ~ Airline, data=SixAirline, mean) Hide
library(lattice) barchart(PitchEconomy ~ Airline, data=seate.mean, col="grey") barchart(PitchPremium ~ Airline, data=seatp.mean, col="grey")
widthe.mean <- aggregate(WidthEconomy ~ Airline, data=SixAirline, mean)
widthp.mean <- aggregate(WidthPremium ~ Airline, data=SixAirline, mean) Hide
barchart(WidthEconomy ~ Airline, data=widthe.mean, col="grey") barchart(WidthPremium ~ Airline, data=widthp.mean, col="grey")
scatterplotMatrix( SixAirline[ ,c("PitchPremium","PitchEconomy")],
spread=FALSE,
smoother.args=list(lty=2),
main="Scatter Plot Matrix")
scatterplotMatrix( SixAirline[ ,c("WidthPremium","WidthEconomy")],
spread=FALSE,
smoother.args=list(lty=2),
main="Scatter Plot Matrix")
scatterplotMatrix( SixAirline[ ,c("PriceEconomy","PricePremium")],
spread=FALSE,
smoother.args=list(lty=2),
main="Scatter Plot Matrix")
scatterplotMatrix( SixAirline[ ,c("SeatsPremium","SeatsEconomy")],
spread=FALSE,
smoother.args=list(lty=2),
main="Scatter Plot Matrix")
scatterplotMatrix( SixAirline[ ,c("PitchDifference","WidthDifference")],
spread=FALSE,
smoother.args=list(lty=2),
main="Scatter Plot Matrix")
library(car) scatterplot(PricePremium ~ PitchDifference, data=Airline, spread=FALSE, smoother.args=list(lty=2), pch=19, main="Scatterplot of Pitch Diff", xlab="PitchDifference", ylab="PricePremium")
scatterplot(PriceEconomy ~ PitchDifference, data=Airline, spread=FALSE, smoother.args=list(lty=2), pch=19, main="Scatterplot of Pitch Diff", xlab="PitchDifference", ylab="PriceEconomy")
scatterplot(PriceEconomy ~ WidthDifference, data=Airline, spread=FALSE, smoother.args=list(lty=2), pch=19, main="Scatterplot of Width Diff", xlab="WidthDifference", ylab="PriceEconomy")
scatterplot(PricePremium ~ WidthDifference, data=Airline, spread=FALSE, smoother.args=list(lty=2), pch=19, main="Scatterplot of Width Diff", xlab="WidthDifference", ylab="PricePremium")
library(corrgram) corrgram(SixAirline, order=FALSE, lower.panel=panel.shade, upper.panel=panel.pie, diag.panel=panel.minmax, text.panel=panel.txt, main="Corrgram of Six Airline intercorrelations")
options(digits=2) cor(SixAirline$PitchPremium, SixAirline$PricePremium) cor(SixAirline$WidthPremium, SixAirline$PricePremium) cor(SixAirline$PitchEconomy, SixAirline$PriceEconomy) cor(SixAirline$WidthEconomy, SixAirline$PriceEconomy)
resP <- cor.test(SixAirline$WidthPremium, SixAirline$PricePremium, method = "pearson") resP
resE <- cor.test(SixAirline$WidthEconomy, SixAirline$PriceEconomy, method = "pearson") resE
t.test(SixAirline$PitchPremium, SixAirline$PricePremium)
t.test(SixAirline$WidthPremium, SixAirline$PricePremium)
m2 <- lm(PricePremium ~ PitchPremium + WidthPremium, data=SixAirline) summary(m2)