1. Homepage
  2. Programming
  3. Assignment 1: FARE Prediction Airfares

Assignment 1: FARE Prediction Airfares

Engage in a Conversation
FARE PredictionAirfaresUSIllinoisR

Assignment 1 CourseNana.COM

Instruction: CourseNana.COM

v  You can use this WORD file as an answer sheet. Attach required output below each question. R codes can be attached to each question or at the end of the document (for partial credits if your results are not correct). CourseNana.COM

v  Name the word file as:  YourName.doc CourseNana.COM

  CourseNana.COM

The following problem takes place in the US in the late 1990’s, when many major US cities were facing issues with airport congestion, partly as a result of the 1978 deregulation of airlines. Both fares and routes were freed from regulation, and low-fare carriers such as Southwest began competing on existing routes and starting nonstop service on routes that previously lacked it. Building completely new airports is generally not feasible, but sometimes decommissioned military bases or smaller municipal airports can be reconfigured as regional or larger commercial airports. There are numerous players and interests involved in the issue (airlines, city, state and federal authorities, civic groups, the military, airport operators), and an aviation consulting firm is seeking advisory contracts with these players. The firm needs predictive models to support its consulting service. One thing the firm might want to be able to predict is fares, in the event a new airport is brought into service. The firm starts with the file Airfares.csv, which contains real data that were collected between Q3-1996 and Q2-1997. The variables in these data are listed below, and are believed to be important in predicting FARE. Some airport-to-airport data are available, but most data are at the city-to-city level. One question that will be of interest in the analysis is the effect that the presence or absence of Southwest (SW) has on FARE. CourseNana.COM

v  COUPON: Average number of coupons (a one-coupon flight is a nonstop flight, a two-coupon flight is a one-stop flight, etc.) for that route CourseNana.COM

v  NEW: Number of new carriers entering that route between Q3-96 and Q2-97 CourseNana.COM

v  VACATION: Whether (Yes) or not (No) a vacation route CourseNana.COM

v  SW: Whether (Yes) or not (No) Southwest Airlines serves that route CourseNana.COM

v  HI: Herfindahl index, which measures market concentration CourseNana.COM

v  S_INCOME: Starting city’s average personal income CourseNana.COM

v  E_INCOME: Ending city’s average personal income CourseNana.COM

v  S_POP: Starting city’s population CourseNana.COM

v  E_POP: Ending city’s population CourseNana.COM

v  SLOT: Whether or not either endpoint airport is slot controlled (this is a measure of airport congestion) CourseNana.COM

v  GATE: Whether or not either endpoint airport has gate constraints (this is another measure of airport congestion) CourseNana.COM

v  DISTANCE: Distance between two endpoint airports in miles CourseNana.COM

v  PAX: Number of passengers on that route during period of data collection CourseNana.COM

v  FARE: Average fare on that route CourseNana.COM

  CourseNana.COM

  CourseNana.COM

1 Exploratory Analysis CourseNana.COM

1.1) Explore the numerical predictors and response (FARE) by creating a correlation table and examining some scatterplots between FARE and those predictors. What seems to be the best single predictor of FARE? Hint: consider ggpairs() function. CourseNana.COM

Attach your results here CourseNana.COM

  CourseNana.COM

1.2) Use either bar chart or frequency table to show the distribution of categorical predictors (VACATION, SW, SLOT, GATE). CourseNana.COM

Attach your results here CourseNana.COM

  CourseNana.COM

1.3) For each categorical predictor, plot the average FARE for its categories. CourseNana.COM

Attach your results here CourseNana.COM

  CourseNana.COM

2 Explanatory Modeling CourseNana.COM

2.1) Use the whole data, fit a regression of FARE vs all predictors. CourseNana.COM

  CourseNana.COM

Attach your results here CourseNana.COM

  CourseNana.COM

2.2) How many percent of variation in FARE can be explained by the model? CourseNana.COM

  CourseNana.COM

2.3) Does the model explain a significant amount of variation in FARE? Explain your answer. CourseNana.COM

  CourseNana.COM

2.4) Explain the effect that the presence or absence of Southwest (SW) has on FARE. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

3 Predictive Modeling CourseNana.COM

3.1) Partition the data into a training set (60%) and a validation set (40%). Before you sample for training set, run set.seed(1).  Fit a linear regression model to predict FARE with all the predictors using the training set. CourseNana.COM

  CourseNana.COM

Attach model summary here CourseNana.COM

  CourseNana.COM

3.2) Use forward selection to select predictors. Show model summary. CourseNana.COM

Attach model summary here CourseNana.COM

  CourseNana.COM

3.3) Compare the predictive accuracy between model 3.1 and model 3.2. CourseNana.COM

  CourseNana.COM

3.4) With model 3.2, predict the FARE on a route with the following characteristics: COUPON = 1.202, NEW = 3, VACATION = No, SW = No, HI = 4442.141, S_INCOME = $28,760, E_INCOME = $27,664, S_POP =4,557,004, E_POP = 3,195,503, SLOT = Free, GATE = Free, PAX = 12782, DISTANCE = 1976 miles. CourseNana.COM

Hint: create a data frame for the new route, apply model 3.2 on the new data frame with predict() function.  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

You may attach your R codes here (optional) CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
FARE Prediction代写,Airfares代写,US代写,Illinois代写,R代写,FARE Prediction代编,Airfares代编,US代编,Illinois代编,R代编,FARE Prediction代考,Airfares代考,US代考,Illinois代考,R代考,FARE Predictionhelp,Airfareshelp,UShelp,Illinoishelp,Rhelp,FARE Prediction作业代写,Airfares作业代写,US作业代写,Illinois作业代写,R作业代写,FARE Prediction编程代写,Airfares编程代写,US编程代写,Illinois编程代写,R编程代写,FARE Predictionprogramming help,Airfaresprogramming help,USprogramming help,Illinoisprogramming help,Rprogramming help,FARE Predictionassignment help,Airfaresassignment help,USassignment help,Illinoisassignment help,Rassignment help,FARE Predictionsolution,Airfaressolution,USsolution,Illinoissolution,Rsolution,