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

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Comparing multiple means: One-factor analysis of variance

Comparing multiple means: One-factor analysis of variance

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

Comparing multiple means: One-factor analysis of variance

- [Instructor] Sometimes, you can get away with comparing just two groups, but sometimes, you got a lot more than that going on. If you have three groups or four or five, you can't really use a t-test anymore because you get an inflated false positive rate. Instead, it's more common to use the analysis of variance or specifically, the one-way or one-factor analysis of variance, which lets you compare the means of several groups simultaneously. To demonstrate this, I'm going to load a few packages, including the psych package that's going to have some functions I'm going to use in this demonstration. And then I'm going to load the state data, I'm going to save it into df for data frame. This is the information about the state-by-state Google search term popularity, as well as some information about the personality classifications of states. I'm going to save it as a tibble. I'm going to select a few different variables. I'm going to recast psych regions as a factor, and then I'm…

Contents