Displaying 1 result from an estimated 1 matches for "myunif".
Did you mean:
myrunif
2006 Mar 08
1
Want to fit random intercept in logistic regression (testing lmer and glmmML)
...information they give on the variance components is quite
different.
Thanks in advance.
Now I paste in the example code
### Paul Johnson <pauljohn at ku.edu>
### 2006-03-08
N <- 1000
A <- -1
B <- 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 f...