Get startedGet started for free

Linear predictions

Businesses are particularly interested in regressions due to their ability to predict the outcome of a dependent variable given values of an independent variable, either based on a particular A/B group or ignoring the groups.

A company is interested in assessing the impact that the amount of time spent searching on the site has on the amount of money spent on their site. You have created a linear model ignoring groups, spending and ensured the linear regression assumptions have been met. The company is interested in how much money is likely to be spent given 30, 32, or 40 minutes are spent on the website regardless of groups.

The SiteSales dataset and spending linear regression model have been loaded for you.

This exercise is part of the course

A/B Testing in R

View Course

Exercise instructions

  • Store the time we are interested in predicting, 30, 32, and 40 minutes in a a variable called TimeSearching.
  • Store the time in a data frame called timepredict.
  • Determine the amount likely to be spent given the time points we are interested in and the spending model.

Hands-on interactive exercise

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

# Store the data to predict
TimeSearching <- c(___)

# Store the data in a data frame
timepredict <-  data.frame(___)

# Determine the amount expected to spend
predict(___, newdata = ___)
Edit and Run Code