Skip to content

Instantly share code, notes, and snippets.

@lawsofthought
Created March 12, 2018 21:49
Show Gist options
  • Save lawsofthought/0dc6cd92548e8591cb0b16e8bf226d5b to your computer and use it in GitHub Desktop.
Save lawsofthought/0dc6cd92548e8591cb0b16e8bf226d5b to your computer and use it in GitHub Desktop.
How to do a binomial (not binary) logistic regression
library(tibble)
ilogit <- plogis # inverse logit
Df <- tibble(corpus = c('bnc_subset', 'subset'),
count = c(5242, 10092),
total = c(27449, 56355))
M <- glm(cbind(count, total-count) ~ 0 + corpus,
data = Df,
family = binomial)
# Confidence intervals on the proportions for "subset" and "bnc"
ilogit(confint(M))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment