sum(4,5)
[1] 9
These materials focus on conceptual foundations of generalized linear modeling (GLMs), specifying them, and interpreting the results. Topics include __________.
Readers should be comfortable with multiple linear regression, including building regression models, interpreting regression output, and testing for and interpreting regression coefficients including interactions. The first module can be used to test for preparedness. We recommend UCLA’s Statistical Methods and Data Analytics resources and online seminars for a more in-depth review: https://stats.oarc.ucla.edu/other/mult-pkg/seminars/
In addition, readers should also be comfortable with foundational concepts in statistics like sampling distributions, Null Hypothesis Significance Testing (NHST), and p-values.
These modules will use a variety of R packages which can be installed through the R CRAN network. We encourage readers to become familiar with the syntax of these packages through documentations pages, which we also supply here. We appreciate these packages because they help to visualization and provide clarity to model outputs.
easystats
: An R framework for easy statistical modeling, visualization, and reporting. easystats
package documentation
tidyverse
: A collection of R packages designed for data science. tidyverse
package documentation
ggeffects
: Estimated Marginal Means and Adjusted Predictions from Regression Models. ggeffects
package documentation
For GLM model fitting, modules will utilize the glm function in the stats
base R package, or the glmmTMB
package, for fitting GLMs. We refer readers to the glmmTMB
package documentation for further information.
As of R 4.1.0, a native pipe operator |>
has been introduced, and we will use this pipe operator throughout our modules. We appreciate pipes as a way to declutter our code, and we find that they are not that much difficult to follow.
For example, if you wanted to use the sum()
function, you would input a vector of numbers into the function as so:
Instead, with pipes, you can declare the vector and pipe it (i.e., feed it) to the same function and get the same result:
This example is kind of contrived, but it is true that pipes allow for passing results/objects to the next function in an elegant way.
For our visualizations, we have set our plots with a template to show a specific layout for aesthetic purposes. We embedded this template in a variable called mytheme
and it is in the code with every plot. The settings of this layout is hidden from view for every module, but we display the custome settings here.
We recommend the following textbooks and websites for more in-depth readings of GLMs. We also extend our thanks for these resources as they have helped us create our modules.
All materials are available for download in the appendix. The following are available for download:
We recommend that people self-studying download the data and R script and following along with the code and output interpretations in each chapter. Instructors can benefit from downloading the data, code, and worksheets for use in a lab portion in their classes.