Create a new variable that splits wday variable into terms

Assignment Help Other Subject
Reference no: EM132392816

Model Building Homework

1. What do you think is the cause for the days with the highest and lowest residual values? Look at all days with abs(resid) > 80.

term <- function(date) {

cut(date,

breaks = ymd(20130101, 20130301, 20130605, 20130825, 20140101),

labels = c("winter","spring", "summer", "fall")

)

}

# add day of week and term to count by date

daily <- flights %>%

mutate(date = make_date(year, month, day)) %>%

count(date) %>%

mutate(wday = wday(date, label = TRUE)) %>%

mutate(term = term(date))

mod1 <- lm(n ~ wday * term, data = daily)

daily_res <- daily %>%

add_residuals(mod1, "resid")

2. Create a new variable that splits the wday variable into terms (seasons), but only for Saturdays, i.e. it should have Sun, Mon, Tue, Wed, Thu, Fri, but Sat-winter, Sat-summer, Sat-spring, Sat-fall. Use cutoff dates of March 1, June 5, Aug 25 to separate into seasons. How does this model compare with the model with every combination of wday and term? Plot both model residuals side by side.

3. Create a new variable that combines the day of week, term (for Saturdays), and public holidays that you identified in number 1. So, the possible values of that variable will be Sun, Mon, Tues, Wed, Thu, Fri, Sat - winter, Sat-summer, Sat - spring, Sat - fall, holiday. What do the residuals of that model look like? Do this first as one factor called holiday for all the dates with large absolute value residuals. Then do it again with one factor for the high residual dates and another for the low residual dates. (This second model will have possible values of Sun, Mon, Tues, Wed, Thu, Fri, Sat - winter, Sat-summer, Sat - spring, Sat - fall, holiday-high, holiday-low. Which model works better?

4. Create a variable that contains the day of the week unless it is one of the two types you identified in the second part of number 3. So, it will contain one of the values Sun, Mon, Tues, Wed, Thu, Fri, Sat, holiday-high, holiday-low. Produce a model that models n based on both that variable and the term as well as their interaction. Plot the residuals.

5. Use what you have learned above to predict the number of flights for 2020 per day. Print a graph that overlays the number of flights in 2013 with your number of predicted flights in 2020. How many flights do you predict for each day June 20 - July 10 of 2020?

Attachment:- Assignment Instructions.rar

Reference no: EM132392816

Questions Cloud

What is the firm expected dividend stream : a. What is the firm's expected dividend stream over the next 3 years? b. What is the firm's current stock price?
What your required rate of return would be : Now your decision, if you were thinking about investing in a stock with a beta (b) of 1.5, show me what your required rate of return would be?
What is the company cost of equity capital : The firm's weighted average cost of capital is 9 percent and its pretax cost of debt is 6 percent. The tax rate is 21 percent.
What is the new strike price after the stock split : (a) What is the new strike price after the stock split? (b) What is the number of shares that can be sold after the stock split
Create a new variable that splits wday variable into terms : Create a new variable that combines the day of week, term, and public holidays that you identified in number 1. Create a new variable that splits the wday.
What must the beta of stock be : A stock has an expected return of 14.3 percent, the risk-free rate is 3.9 percent, and the market risk premium is 7.8 percent. What must the beta of stock be
Nominal and effective costs of trade credit : What are the nominal and effective costs of trade credit under the credit terms of 3/10, net 30? Assume 365 days in a year for your calculations.
What is the value of a preferred stock : What is the value of a preferred stock where the dividend rate is 15 percent on a ?$100 par? value, and the? market's required yield on similar shares
Importance of continuity planning in business : Write a 750-1000 word paper in APA format on the importance of continuity planning in business and how to gain senior management support.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd