Skip to content

Commit 5edafde

Browse files
committed
updated ANOVA section
1 parent 28e9683 commit 5edafde

File tree

8 files changed

+57
-16
lines changed

8 files changed

+57
-16
lines changed

._educer.Rproj

4 KB
Binary file not shown.
4 KB
Loading
4 KB
Loading
4 KB
Loading
-8 KB
Binary file not shown.
-2.94 KB
Binary file not shown.

inst/tutorials/statistical_models_ws/statistical_models_ws.Rmd

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ question("In rejecting the null hypothesis, one can conclude that all the popula
640640
```
641641

642642
#### **Exercise 3: ANOVA cont.**
643-
![](images/rstudio_logo.png){width=0.4in} Exercise.
643+
![](inst/resources/images/rstudio_logo.png){width=0.4in} Exercise.
644644
Complete the following multiple choice questions.
645645

646646
```{r aov_mc_1, echo=FALSE}
@@ -666,6 +666,34 @@ question("Which of the following is an assumption of 0ne-way ANOVA comparing sam
666666
```
667667

668668
## 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.
669685

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`.
670687

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!
671689

690+
```{r gapminder-package, exercise = TRUE}
691+
# load and check the data
692+
library(<package>)
693+
<function>(gapminder)
694+
```
695+
696+
```{r gapminder-package-solution}
697+
library(gapminder)
698+
head(gapminder)
699+
```

inst/tutorials/statistical_models_ws/statistical_models_ws.html

Lines changed: 28 additions & 15 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)