” 辅导R留学生程序、 写作data程序Applied Statistics with R Final Exam 2020-05-22 Exam ID 00003Name:Student ID:4. (a)Applied Statistics with R Final Exam: 00003 2Applied Statistics with R Final Exam: 00003 3Applied Statistics with R Final Exam: 00003 41. Load the data provided in flights.Rdata from **piazza** and select all flights that hadbeen scheduled For departure between 2013-03-15 and 2013-03-19.(a) How many flights (i.e. cases) are in the resulting data set?(b) How many variables does the resulting data set comprise?2. Plot a box plot of the departure delays (variable dep_delay) using the departure airport(variable origin) as grouping variable.(a) Do the three NYC airports show a similar distribution in departure delays?(b) Are the median departure delays for each airport close to zero?(c) Which flight (from Where to where) came the earliest (had the smallest departure delay)?(d) Which flight (from Where to where) has the largest departure delay?3. Create a categorical variable delay with three categories: on time: flights with an arrival delay less than 14 minutes delayed: flights with an arrival delay between 14 and 41 minutes heavy Delay: flights with an arrival delay of more than 41 minutesOrder the variable according to on time, delay, heavy delay.(a) Compute the number of flights in category delay.(b) Compute the number of flights in category on time.(c) Compute the number of flights in category heavy delay.(d) Which delay category is the most frequent one?4. Cross-tabulate the variables origin and delay.(a) What is the most-frequent combination of the two variables origin and delay?(b) Which share of on time flights departed from LGA?(c) Which share of flights departing from LGA have been in delay category on time ?5. Assess the relationship between origin and delay using the 辅导R留学生程序、 写作data程序作业、 辅导程序语言作业-statistic. Calculate theexpected frequencies under the assumption that the departure airport has no effect onarrival delays.(a) Is the relationship statistically significant?(b) Report the score of the 2-test statistic (round to two digits)!(c) Which (sampling) Distribution is used for the 2-test to compute the p-value?(d) For which cells are expected frequencies higher than the observed ones?6. The IATA claims that New York City airports are delaying air traffic. In order to investigatthis claim, check whether departure delays are on average signfificantly higher than arrivaldelays. Use an appropriate Statistical test using the 5% significance level.(a) Which statistical test is most appropriate here?(b) Is the relationship statistically significant?(c) Report the score of the test statistic (round to two digits)!(d) Can you confirm the IATA claim?Applied Statistics with R Final Exam: 00003 57. The IATA wants to know whether all three airports in New York City operate at the sameperformance level regarding departure delays. Use a suitable statistical test to check this!(a) Is there a difference in performance regarding departure delays between the threeairports?(b) Which statistical test did you use?(c) Report the test statistics score!(d) Report the total sum of squares accounted by origin!(e) Which airports differ statistically significantly in their performance?(f) Which airport has the best performance?8. In the following, you restrict your analysis to flights that have an arrival delay of at least 34minutes. Create the corresonding data subset.(a) How many flights are in this subset?(b) How many flights have been excluded by this procedure?9. You are interested in the (linear) relationship between departure delay and arrival delay.(a) Would you expect any relationship? If yes, which one? / Calculate the kendall correlationcoefficient and comment on it.(b) Draw a scatter plot of number of arrival delay against departure delay and commenton it. / Discuss whether this correlation coefficient is an appropriate measure in thissituation!10. Compute a linear model for arrival delay as dependent variable using the following variablesin the data set as predictors: dep_delay, origin, air_time, carrier, dest, month,day. Call this model flights.lm!(a) According to the ANOVA table, is the predictor dest statistically significant (at least) atthe 10% significance level?(b) Looking at the regression coefficients, briefly discuss what the coefficients for originJFKand originLGA mean?(c) How good does this model fit? On what do you base your judgment?(d) Check whether the residuals of this model follow a normal distribution! Do they? Whichtool did you use for checking this?11. Starting with the null model and taking the model flights.lm as upper bound, run a stepwisemodel selection procedure to find the best model according to the AIC criterion. Callthe resulting model flights.lm.best!(a) Which predictors are included in the optimal model?(b) Report the adjusted R-squared of the final model?(c) Report the AIC of the final model?(d) Using an F-test check whether the final (= best according to automatic variable selection)model is significantly different from the model using the predictors as computedin the previous exercise?(e) Which predictors are included in the model computed in the previous exercise that arenot included in the final model obtained by the automatic procedure?(f) According to the final model, by how many minutes more is a flight at arrival delayed ifit departs 10 minutes later (all other things being equal).Applied Statistics with R Final Exam: 00003 6(g) According to the final model, which carrier is the best to minimize arrival delays.(h) Amend the final model by adding an interaction term between origin and air_time.Is the interaction term significant at the 10% level? According to this model and allother things equal, by how much will departure delays differ for two flights having adifference in air time of 100 minutes and one leaving from EWR, the other from JFK(all other things being equal)?12. You now want to generate a classification model that tells you whether a flight is delayed atarrival more than 92 minutes using the predictors in the model flights.lm.best. Use theprobit link here! Call the model flights.classbin!(a) Which error distribution have you chosen to create this model?(b) According to the Wald tests (Table of coefficients): which predictors are significant (atleast at the 5% level)?(c) According to the Likelihood-Ratio Test (LR-test as given in the Deviance Table): whichpredictors are significant (at least at the 5% level)?(d) Report the residual deviance of your model?(e) Report the Null deviance of your model?(f) Using a 2-test check whether your model is significantly better than the null model?(g) According to your model, how does the air time of a flight influence the likelihood of itbeing more than two hours delayed?(h) Based on your models fitted probabilites for being more than two hours delayed createan indicator for delayed/not delayed flights using the probability 0.5 as threshold.Create a frequency table of the predicted and the observed delay indicator. Calculateall misclassification rates.13. Using the model flights.classbin predict the probability for being more than two hoursdelayed at departure using the average scores of numeric predictors in the model for carrierUA (United Air Lines) and destination ORD (Chicago Ohare International) and origin JFK.14. Again using the model flights.classbin, you now want to investigate the specific dependencyon the hour of the day. In case hour is not yet included in the model, update themodel by adding this predictor. Generate new data such that you have the hours from 5 to23 in increments of 1. The other numeric predictors enter again with their mean score intothe prediction in the model for carrier UA (United Air Lines) and destination ORD (ChicagoOhare International). Compute the predictions and average them.15. What is the name of the R function for multinomial logistic regression?如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。