You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -666,6 +666,34 @@ question("Which of the following is an assumption of 0ne-way ANOVA comparing sam
666
666
```
667
667
668
668
## Linear regression
669
+
Now, we will work with a data frame that Jenny Bryan (UBC and RStudio) put together in the [`gapminder` package](https://www.gapminder.org/data/).
670
+
671
+
Unlike the fruit fly data set, no pre-manipulation is needed so let's view the data as is. First, load the gapminder package and use the `head()` function to explore the data:
672
+
673
+
```{r gapminder-package, exercise = TRUE}
674
+
# load and check the data
675
+
library(<package>)
676
+
<function>(gapminder)
677
+
```
678
+
679
+
```{r gapminder-package-solution}
680
+
library(gapminder)
681
+
head(gapminder)
682
+
```
683
+
684
+
We see that the data contain infomation on life expectancy (lifeExp), population (pop), and gross domestic product per capita (gdpPercap, a rough measure for economical richness) for many coutries across many years.
669
685
686
+
A very naive working hypothesis that you may come to is that our life expectancy grew with time. This would be represent in r with `lifeExp ~ year`.
670
687
688
+
Let's explore this hypothesis graphically. Using the `gapminder` data set, create a scatterplot with `year` on the x-axis and `lifeExp` on the y-axis. Remember to create human readable labels!
0 commit comments