Skip to content

Instantly share code, notes, and snippets.

@seankross
Created March 7, 2018 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seankross/0e161e5aca6818fe912979b528df0352 to your computer and use it in GitHub Desktop.
Save seankross/0e161e5aca6818fe912979b528df0352 to your computer and use it in GitHub Desktop.
Getting p-values out of a model, two ways
berkeley <- as.data.frame(UCBAdmissions)
model <- glm(Admit ~ Gender + Dept + Freq, data = berkeley, family = "binomial")
# Base R
model_summary <- summary(model)
model_summary$coefficients[,4]
# Or become one of the cool kids
library(broom)
tidy(model)$p.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment