library(tidyverse)
library(tidymodels)
library(scatterplot3d)

Bulletin

Learning goals

To begin, we’ll work with a new set of pokemon data.

pokemon <- read_csv("data/pokemon150.csv")

Exercise 1)

Previously we looked at building a model to predict a pokemon’s hit points using height.

Last time we noticed both height and weight are correlated with a pokemon’s hit points.

Other variables may be correlated with hp, e.g. a pokemon’s legendary status.

Do legendary pokemon have higher hp than non-legendary pokemon? Compare mean hp between groups to support your answer.

# code here

Write down a model to predict a pokemon’s hitpoints based on their height, weight, legendary status (use \(x\), \(y\), \(\beta\) notation). Define each variable.

Exercise 2)

Use tidymodel syntax to build a linear model and estimate each \(\beta\).

# code here

Interpret the meaning of your estimates and write a brief description below. Use/discuss the the phrase “all else held constant” with your neighbor.

Exercise 3)

Do the coefficients match your expectations for the previous exercise? Why or why not? Write code to explore any oddities further.

# code here

Exercise 4)

Some think that certain pokemon types have higher hp than others.

pokemon %>%
  group_by(type_1) %>%
  summarize(mean_hp = mean(hp), n = n())

a) Construct a linear model in R to determine the effect of pokemon type on hp.

# code here

b) Interpret the meaning of your estimates and write a brief description below. Are any types missing?

c) Given the output of your code, write down the linear model (use \(x\), \(y\), \(\beta\) notation). Define each variable.