Statistical Inference with R
Linear & Logistic Regression Modeling
Building and interpreting regression models for continuous and binary outcomes
Dan Kerchner Β· George Washington University Libraries & Academic Innovation Β· Fall 2026
There will be more in the Spring!
π Find all GW Libraries workshops and events at library.gwu.edu/events
\[ Y = \beta_0 + \beta_1X_1+\beta_2X_2 + ... + \beta_nX_n \] where \(Y\) is a continuous variable.
(and an interaction term might look like \(\beta_{1,2}X_1X_2\))
Interpretation
\(\beta_0\) = Mean \(Y\) when \(X_i\) values are \(0\)
\(\beta_1\) = Mean change in \(Y\) for a 1-point increase in \(X_1\), adjusting for other \(X_i\) variables
Pearson correlation (\(\rho\)) measures strength and direction (+/-) of linear association between \(X_i\) and \(Y\). Ranges from -1 to +1.
If the relationship looks non-linear (but monotonic) then Spearman correlation should be considered.
\[ H_0: \rho = 0 \] \[ H_1: \rho \neq 0 \]
Valid if joint distribution of X, Y is bivariate normal.
\(g(\mu) = \beta_0 + \beta_1X_1 + \beta_2X_2 + ... + \beta_nX_n\)
where \(\mu = E(Y)\)
Common link functions
\(g(\mu) = \mu\)
\(g(\mu) = log(\mu)\)
\(g(\mu| = log(\frac{\mu}{1-\mu}) = logit(\mu)\)
\(log({\frac{p}{1-p}}) = \beta_0 + \beta_1X_1 + \beta_2X_2 + ... + \beta_nX_n\)
where
\(p\) = Probability of \(Y = 1\)
\(1-p\) = Probability of \(Y = 0\)
Interpretation
\(\beta_i\) = log OR (odds ratio) for having \(Y=1\) for a 1-point increase in \(X_i\), adjusting for other predictors
\(e^{\beta_i}\) = OR (odds ratio) for having \(Y=1\) for a 1-point increase in \(X_i\), adjusting for other predictors
Confidence Interval
95% CI for \(\beta\) = (0.44, 0.49)
Hypothesis Testing
\(H_0: \beta = \beta_0\) <- Null Hypothesis
\(H_A: \beta \neq \beta_0\) <- Alternative Hypothesis
p-value: Chance that weβre rejecting \(H_0\) when we shouldnβt be
Learn to use R to read in data and conduct regresison analysis with associated inference tests
(with both continuous and categorical predictors)
Siddarth P, Burggren AC, Eyre HA, Small GW, Merrill DA (2018) Sedentary behavior associated with reduced medial temporal lobe thickness in middle-aged and older adults. PLoS ONE 13(4): e0195549. doi.org/10.1371/journal.pone.0195549

Anscombeβs Quartet

Datasaurus Dozen

lme4 - Linear mixed-effects modelsMASS - Model selectionts(), arima() - Time series object, model (part of stats)forecast - Forecasting for time series and linear modelsmice - imputation of missing datamedflex - mediation analysissplines2 - regression spline basis functionssurvival - survival analysis; JM - joint modelingDan Kerchner | George Washington University Libraries
kerchner@gwu.edu
Stats & Coding help @ GW:
| me | R, Python, etc. | calendly.com/kerchner |
| Academic Commons Data Consultants | R, Statistics, Python, SAS, Excel, etc. | go.gwu.edu/DataConsulting |
| LAI Software developers | Python, web apps, HTML, etc. | calendly.com/gwul-coding |
These slides: kerchner.github.io/r4stats/regression
Code: github.com/kerchner/r4stats in the regression/R folder
R LibGuide: libguides.gwu.edu/r_stats
Statistical Inference with R Β· GW Libraries & Academic Innovation Β· kerchner.github.io/r4stats