Description Usage Arguments Examples

View source: R/lm.contribution.R

Takes a lm and applies coefficients to show how each independent variable contributes to the dependent variable. IMPORTANT: lm(data = ?) has to be a data.table.

1 | ```
lm.contribution(lm.object, date.index = "Week")
``` |

`lm.object` |
lm object. A lm saved to a variable. |

`date.index` |
Character. The date index of the lm(data = ?) variable. |

1 2 3 4 5 | ```
x <- data.table::fread(system.file("extdata", "lm.csv", package = "nladwa"))
x[, Week := excelDateToRDate(Week)]
lm.x <- lm(TotalGrossLeads ~ Search.Spend + Competitor.Spend, data = x)
lm.object <- lm.contribution(lm.object = lm.x, date.index = "Week")
print(lm.object)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.