Skip to content

Commit

Permalink
Fixes #5. Improve figure axes and labels for Fig 3, 4, and 5
Browse files Browse the repository at this point in the history
  • Loading branch information
rosemm committed Oct 3, 2024
1 parent 92ff701 commit 09f22d1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Binary file modified reports/figures/change_by_asynch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified reports/figures/change_by_engagement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified reports/figures/change_by_pathway_fit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions reports/notebooks/w2_hypothesis_testing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -413,45 +413,54 @@ knitr::include_graphics(here::here("reports", "tables", "descriptives_covariates
height = 5)
```

```{r}
```{r change_by_engagement}
(data |>
tidyr::pivot_longer(tidyselect::ends_with("_change")) |>
dplyr::mutate(name = gsub(x=name, pattern = "(\\1)_change", replacement = "\\1")) |>
dplyr::mutate(name = dplyr::case_when(name == "ability_change" ~ "Data Science Ability",
name == "openscience_change" ~ "Open Science Values",
.default = name)) |>
ggplot(aes(x=engagement, y=value)) +
geom_point(alpha = .5) +
stat_smooth(method = "lm", color = chop_blue) +
facet_wrap(~name, ncol = 2) +
labs(y = "Change from pre to post")) |>
labs(y = "Change from pre to post",
x = "Engagement\n(proportion of modules completed)")) |>
# the save_and_print function is defined in functions_plotting.R
save_and_print(filename = "change_by_engagement.png",
width = 5,
height = 3)
```

```{r}
```{r change_by_asynch}
(data |>
tidyr::pivot_longer(tidyselect::ends_with("_change")) |>
dplyr::mutate(name = gsub(x=name, pattern = "(\\1)_change", replacement = "\\1")) |>
dplyr::mutate(name = dplyr::case_when(name == "ability_change" ~ "Data Science Ability",
name == "openscience_change" ~ "Open Science Values",
.default = name)) |>
ggplot(aes(x=asynch, y=value)) +
geom_point(alpha = .5) +
stat_smooth(method = "lm", color = chop_blue) +
facet_wrap(~name, ncol = 2) +
labs(y = "Change from pre to post") ) |>
labs(y = "Change from pre to post",
x = "Preference for asynchronous learning")) |>
# the save_and_print function is defined in functions_plotting.R
save_and_print(filename = "change_by_asynch.png",
width = 5,
height = 3)
```

```{r}
```{r change_by_pathway_fit}
(data |>
tidyr::pivot_longer(tidyselect::ends_with("_change")) |>
dplyr::mutate(name = gsub(x=name, pattern = "(\\1)_change", replacement = "\\1")) |>
dplyr::mutate(name = dplyr::case_when(name == "ability_change" ~ "Data Science Ability",
name == "openscience_change" ~ "Open Science Values",
.default = name)) |>
ggplot(aes(x=pathway_fit, y=value)) +
geom_point(alpha = .5) +
stat_smooth(method = "lm", color = chop_blue) +
facet_wrap(~name, ncol = 2) +
labs(y = "Change from pre to post") ) |>
labs(y = "Change from pre to post",
x = "Pathway fit")) |>
# the save_and_print function is defined in functions_plotting.R
save_and_print(filename = "change_by_pathway_fit.png",
width = 5,
Expand Down

0 comments on commit 09f22d1

Please sign in to comment.