I am interested in changing the null hypotheses using glm()
in R.
For example:
x = rbinom(100, 1, .7)
summary(glm(x ~ 1, family = "binomial"))
tests the hypothesis that $p = 0.5$. What if I want to change the null to $p$ = some arbitrary value, within glm()
?
I know this can be done also with prop.test()
and chisq.test()
, but I'd like to explore the idea of using glm()
to test all hypotheses relating to categorical data.
glm
by default) is the logit, to avoid confusion it's important to distinguish $p$ from its logit, which is the log odds $\log(p/(1-p))$. $\endgroup$