Get startedGet started for free

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.

This exercise is part of the course

A/B Testing in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create a linear regression model
spending <- lm(___) 
summary(___)
Edit and Run Code