# \donttest{
set.seed(321)
n=8000
beta0=function(t) 0.1*t-1
beta1=function(t) cos(2*pi*t)
beta2=function(t) sin(2*pi*t)
alph1=alph2=1
x=matrix(runif(n*4,min=-4,max=4),nrow=n,ncol=4)
t=sort(runif(n))
coef=cbind(beta0(t),beta1(t),beta2(t),rep(alph1,n),rep(alph2,n))
covar=cbind(rep(1,n),x)
linear=apply(coef*covar,1,sum)
prob=exp(linear)/(1+exp(linear))
y=as.numeric(runif(n)Run the code above in your browser using DataLab