## 15.6 Test your might! A ship auction

The following questions apply to the auction dataset in the yarrr package. This dataset contains information about 1,000 ships sold at a pirate auction. Here’s how the first few rows of the dataframe should look:

head(auction)
##   cannons rooms age condition  color   style  jbb price price.gt.3500
## 1      18    20 140         5    red classic 3976  3502          TRUE
## 2      21    21  93         5    red  modern 3463  2955         FALSE
## 3      20    18  48         2   plum classic 3175  3281         FALSE
## 4      24    20  81         5 salmon classic 4463  4400          TRUE
## 5      20    21  93         2    red  modern 2858  2177         FALSE
## 6      21    19  60         6    red classic 4420  3792          TRUE
1. The column jbb is the “Jack’s Blue Book” value of a ship. Create a regression object called jbb.cannon.lm predicting the JBB value of ships based on the number of cannons it has. Based on your result, how much value does each additional cannon bring to a ship?

2. Repeat your previous regression, but do two separate regressions: one on modern ships and one on classic ships. Is there relationship between cannons and JBB the same for both types of ships?

3. Is there a significant interaction between a ship’s style and its age on its JBB value? If so, how do you interpret the interaction?

4. Create a regression object called jbb.all.lm predicting the JBB value of ships based on cannons, rooms, age, condition, color, and style. Which aspects of a ship significantly affect its JBB value?

5. Create a regression object called price.all.lm predicting the actual selling value of ships based on cannons, rooms, age, condition, color, and style. Based on the results, does the JBB do a good job of capturing the effect of each variable on a ship’s selling price?

6. Repeat your previous regression analysis, but instead of using the price as the dependent variable, use the binary variable price.gt.3500 indicating whether or not the ship had a selling price greater than 3500. Call the new regression object price.all.blr. Make sure to use the appropriate regression function!!

7. Using price.all.lm, predict the selling price of the 3 new ships below

cannons rooms age condition color style
12 34 43 7 black classic
8 26 54 3 black modern
32 65 100 5 red modern
1. Using price.all.blr, predict the probability that the three new ships will have a selling price greater than 3500.