Description Usage Arguments Examples
Takes a lm object and outputs an actual vs fitted table.
1 | lm.trainAndTest(lm.object, date.index = "Week", test.dep.var = FALSE)
|
lm.object |
lm object. A lm saved to a variable. |
date.index |
Character. The date index of the lm(data = ?) variable. |
test.dep.var |
Character. Defaults to FALSE which replaces ".Train" in the dependent variable (from lm.object), with ".Train". If you know that variable doesn't exist, enter the variable name here. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | x <- data.table::fread(system.file("extdata", "lm.csv", package = "nladwa"))
x[, Week := excelDateToRDate(Week)]
x <- TrainAndTest.break(x, "TotalGrossLeads", to.break = "2015-04-06", append = TRUE)
# 06/04/2015
lm1 <- lm(TotalGrossLeads.Train ~ Search.Spend + Competitor.Spend, data = x)
lm1.trainAndTest <- lm.trainAndTest(lm.object = lm1, date.index = "Week")
print(lm1.trainAndTest)
lm.trainAndTest.ggplot(lm1.trainAndTest)
lm.trainAndTest.resid.ggplot(lm1.trainAndTest)
MAPE.trainAndTest(lm1.trainAndTest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.