From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data

Unlock the full course today

Join today to access over 23,000 courses taught by industry experts.

Predicting outcomes with Poisson or log-linear regression

Predicting outcomes with Poisson or log-linear regression

From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data

Predicting outcomes with Poisson or log-linear regression

- [Instructor] Standard models of regression are designed for continuous outcomes that measure on a scale of some kind, like an average. But when what you are trying to model is frequencies or how many cases fall into a category, you need to use a different model. And the most common approach goes by two different names. It's either called Poisson regression or log-linear models. They're the same thing. And I want to demonstrate this by first loading up R packages. And then I'm going to come down and use an example data set that's in R. It's called InsectSprays. Let's get a little bit of information about that one. And what I like about this is that it's historical. It's from a paper published in 1942. But it's about six different kinds of insect sprays and how many bugs they each killed. That's what's called count. Let's save that data. InsectSprays to df, for data frame. And let's take a quick look at the first few rows. And what you have here are counts of how many bugs were…

Contents