Exercise

# Visualizing parallel planes

By including the duration, starting price, and condition variables in our model, we now have two explanatory variables and one categorical variable. Our model now takes the geometric form of two parallel planes!

The first plane corresponds to the model output when the condition of the item is `new`

, while the second plane corresponds to the model output when the condition of the item is `used`

. The planes have the same slopes along both the duration and starting price axes—it is the \(z\)-intercept that is different.

Once again we have stored the `x`

and `y`

vectors for you. Since we now have two planes, there are matrix objects `plane0`

and `plane1`

stored for you as well.

Instructions

**100 XP**

- Use
`plot_ly`

to draw 3D scatterplot for`totalPr`

as a function of`duration`

,`startPr`

, and`cond`

by mapping the`z`

variable to the response and the`x`

and`y`

variables to the explanatory variables. Duration should be on the x-axis and starting price should be on the y-axis. Use color to represent`cond`

. - Use
`add_surface()`

(twice) to draw two planes through the cloud of points, one for new MarioKarts and another for used ones. Use the objects`plane0`

and`plane1`

.