Skip to content

Commit

Permalink
Add another weight loss calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dunning authored and Mark Dunning committed Feb 16, 2024
1 parent 564e704 commit 44d74e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions practical-noSolutions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ Let's go back to our example of comparing weight loss between groups male and fe

```{r}
diet %>%
mutate(weight.loss = initial.weight - final.weight) %>%
wilcox_test(weight.loss ~ gender)
```

Expand All @@ -626,6 +627,7 @@ In order to justify if an ANOVA test is appropriate we have to test for normalit
diet %>%
mutate(weight.loss = initial.weight - final.weight) %>%
ggplot(aes(x = diet.type, y = weight.loss)) + geom_violin()
group_by(diet, diet.type) %>%
shapiro_test(weight.loss)
Expand All @@ -635,6 +637,7 @@ A one-way ANOVA compares group means by partitioning the variation in the data i

```{r}
diet %>%
mutate(weight.loss = initial.weight - final.weight) %>%
anova_test(weight.loss ~ diet.type)
```

Expand All @@ -643,6 +646,7 @@ When the test provides a significant result it tells us that there is at least o

```{r}
diet %>%
mutate(weight.loss = initial.weight - final.weight) %>%
tukey_hsd(weight.loss ~ diet.type)
```

Expand Down

0 comments on commit 44d74e2

Please sign in to comment.