Created
June 19, 2020 18:13
-
-
Save omartinez182/db9a34748124ff6c8b911994d02fa34a to your computer and use it in GitHub Desktop.
Understanding Time Series Analysis with R - Snippet 9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Linear model | |
model <- lm(formula = DES ~ t, dfOut) | |
#Predictions | |
f <- predict(object = model, newdata = data.frame(t=dfOut[, 1])) | |
dfOut <- data.frame(dfOut, f=f) | |
#New prediction accounting for seasonality | |
predictions <- dfOut[, 7]*dfOut[, 5] | |
dfOut <- data.frame(dfOut, predictions = predictions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment