Plot the time series of the estimates of the regression


Please bare with me I am VERY new to R and forecasting (enrolled in my first course now). As part of a homework assignment, we are asked to "Choose your favorite model and implement a recursive and a rolling estimation scheme." I have searched for many hours trying to figure out how to do this in R and I can't quite get it. If anybody can provide me with some help I would greatly appreciate it!!!

Full Question: Using the same data set as in Exercise 3 and for house price growth, run several regression models with one, two, three, and four lags of price growth in the rightâ hand side of the model. Analyze the regression results. Choose your favorite model and implement a recursive and a rolling estimation scheme. Plot the time series of the estimates of the regression coefficients and observe how much they change over time.

My Code so far:

PRQ <- read_excel("~/Desktop/144/HW2/Chapter4_exercises_data.xls",sheet = "Exercise 3")

price_ts<-ts(PRQ$P,start = 1980:2, freq=4)

r_price <- diff(log(price_ts)) ##growth rate

lag<-append(NA, r_price[-length(r_price)])

lag2<-append(NA, lag[-length(lag)])

lag3<-append(NA,lag2[-length(lag2)])

lag4<-append(NA, lag3[-length(lag3)])

y1<-lm(r_price~lag)

y2<-lm(r_price~lag+lag2)

y3<-lm(r_price~lag+lag2+lag3)

y4<-lm(r_price~lag+lag2+lag3+lag4)

summary(y1)

summary(y2)

summary(y3)

summary(y4)

Solution Preview :

Prepared by a verified Expert
Basic Statistics: Plot the time series of the estimates of the regression
Reference No:- TGS02272511

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)