Created
March 12, 2018 21:49
-
-
Save lawsofthought/0dc6cd92548e8591cb0b16e8bf226d5b to your computer and use it in GitHub Desktop.
How to do a binomial (not binary) logistic regression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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