Linear regression model
Linear regressions aid in assessing the impact a variable has on another across groups or within a single group, provided the variables have a linear relationship, the residuals have consistent variance with the predicted values, or homoscedasticity, and the residuals are normally distributed.
A company has collected the data of their website's users and is interested in whether the amount of time spent searching for items on the website, TimeSearching
, impacts the amount of money spent purchasing items, AmountSpent
, including both groups the data has been collected on, those experiencing a new and old ad. Create a linear regression model and assess the assumptions of homoscedasticity and normality.
The SiteSales
dataset has been loaded for you.
Cet exercice fait partie du cours
A/B Testing in R
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Create a linear regression model
spending <- lm(___)
summary(___)