In this recipe, we will work with the same dataset that we used before. It contains clientid, deal_size, salespeople_involved, and time_spent_deal. deal_size is the target variable, and the two variables that we have are the number of salespeople involved and the time spent on each deal. Both are expected to have a positive effect on the deal size.
- We first load the necessary dataset and libraries:
library(dplyr) library("lme4") library(ggplot2) data = read.csv("/sample_random_regression.csv") data$clientid = as.factor(data$clientid)
- A useful initial plot, which is usually used in the context of mixed models, is one that shows the dependent variable versus each independent variable faceted by subject. This can be used ...