Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (30) The monthly values of the average hourly wages for U.S. apparel and textile workers for July 1981 to June 1987 are in the

3. (30) The monthly values of the average hourly wages for U.S. apparel and textile workers for July 1981 to June 1987 are in the wages object in the TSA package. Type library(TSA); data(wages); print(wages) in R to see the data set.

a. Plot the time series. What basic pattern do you see from the plot?

b. Fit a linear time trend model using least squares. Give the plot of the linear trend overlain on the data, and give the estimated regression equation.

c. Plot the standardized residuals from the linear regression over time. Comment on any notable pattern.

d. Fit a quadratic time trend model using least squares. Give the plot of the quadratic trend overlain on the data, and give the estimated regression equation. e. Plot the standardized residuals from the quadratic regression over time. Comment on any notable pattern.

I have the code for all of the parts except for part d. I am having trouble fitting a quadratic trend and having that show up like with the linear model. This is my code so far. Please help.

library(TSA) data(wages) print(wages)

plot.ts(wages) wages.lm = lm(wages~time(wages)) summary(wages.lm) abline(wages.lm) coef(wages.lm)

plot(rstandard(wages.lm))

plot.ts(wages) wages.qm = lm(wages~time(wages) + I(time(wages)^2)) summary(wages.qm)

#I couldn't figure out how to add the quadratic trend line with the linear. wages.sq <- seq(1981, 1987, 12) wagespredict <- predict(wages.qm) plot(wagespredict) lines(wagespredict) #So, this is what I stopped with.

coef(wages.qm) plot(rstandard(wages.qm))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

57 Occupational injury and illness compensation and programs.

Answered: 1 week ago

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago