Displaying 1 result from an estimated 1 matches for "myglm1".
Did you mean:
mygam1
2006 Mar 08
1
Want to fit random intercept in logistic regression (testing lmer and glmmML)
...<- 0.3
x <- 1 + 10 * rnorm(N)
eta <- A + B * x
pi <- exp(eta)/(1+exp(eta))
myunif <- runif(N)
y <- ifelse(myunif < pi, 1, 0)
plot(x,y, main=bquote( eta[i] == .(A) + .(B) * x[i] ))
text ( 0.5*max(x), 0.5, expression( Prob( y[i] == 1) == frac( 1 , 1 +
exp(-eta[i] ))))
myglm1 <- glm ( y ~ x, family=binomial(link="logit") )
summary(myglm1)
## Just for fun....
myglm2 <- glm(y~x, family=quasibinomial)
summary(myglm2)
### Mixed model: random intercept with large variance
eta <- A + B * x + 5 * rnorm(N)
pi <- exp(eta)/(1+exp(eta))
myunif <- runi...