G <- 20;n=1000;p=5; nk=50
b=runif(p, 0, 1)
beta =matrix(b,nrow=p)
X=matrix(rnorm(n*p),nrow=n)
L=X%*%beta
prob=1/exp(-(0.48+(L))+1)
y=1/(1+exp(-X))
y=(prob>runif(n))
y= ifelse((prob>runif(n)), 1, 0)
data=cbind(y,X)
pqlBLogist(data,G,nk)
Run the code above in your browser using DataLab