N=20
m=2
k=0
beta=c(0.1,0.1,-0.05)
gamma=c(0.1,-0.05,0.05)
ofst=runif(N,-2.5,-1.5)
x1=round(runif(N,-0.5,9.5))
x2=round(runif(N,-0.5,9.5))
X=cbind(x1,x2)
n=rep(10000,N)
tm=c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
eta=ofst+beta[1]+gamma[1]*tm
if (m>0)
for (i in 1:m)
eta=eta+beta[i+1]*X[,i]
if (k>0)
for (i in 1:k)
eta=eta+gamma[i+1]*pmax(tm-tau[i],0)
y=rbinom(N,size=n,prob=exp(eta)/(1+exp(eta)))
temp.ljr=ljrb(2,y,n,tm,X,ofst,R=1000)
Run the code above in your browser using DataLab