Coding workshop: Week 7

Git and GitHub
tidyverse
here
ggeffects
flextable
here
str
glimpse
class
lm
ggpredict
ggsave
cor.test
plot
geom_ribbon
geom_line
read_csv
ggplot
geom_point
github
forking
Author
Affiliation
Workshop date

May 16, 2024

Modified

June 13, 2024

1. Summary

Packages

  • tidyverse
  • here
  • ggeffects
  • flextable

Operations

New functions

  • organize file paths using here()
  • look at data using str(), glimpse(), and class()
  • construct a linear model using lm()
  • visualize model predictions using ggpredict()
  • saving image using ggsave()
  • calculating correlation using cor.test()
  • plot model diagnostics using plot()
  • plot model 95% CI using geom_ribbon()
  • plot model predictions using geom_line()

Review

  • read in data using read_csv()
  • visualize data using ggplot()
  • create scatterplot using geom_point()

Data sources

The data set is a mock data set generated by me! The code to generate the data is here.

2. Code

All code is in this repository.

All GitHub/Git steps are in this guide. Videos to accompany this guide are on Canvas.