## Not run:
# ## load data
# data(UTIdata)
#
# ## Sort the data by Patient and visit
# o <- order(UTIdata$Patid, UTIdata$Fup)
# UTIdata <- UTIdata[o,]
#
# ## Create censure vector
# cens = (UTIdata$RNAcens==1)+0
#
# ## Generate response vector
# y = log10(UTIdata$RNA)
# aa=y[cens==0]
#
# ## Create the design matrices
#
# x = cbind((UTIdata$Fup==0)+0, (UTIdata$Fup==1)+0, (UTIdata$Fup==3)+0, (UTIdata$Fup==6)+0, (UTIdata$Fup==9)+0, (UTIdata$Fup==12)+0, (UTIdata$Fup==18)+0, (UTIdata$Fup==24)+0)
# z = matrix(rep(1, length(y)), ncol=1)
# cluster = as.numeric(UTIdata$Patid)
#
# ## Create the nj vector
# nj<-matrix(0,72,1)
# for (j in 1:72) {
# nj[j]=sum(cluster==j)
# }
#
# ## Number of individuals
# m<-dim(nj)[1]
#
# ## Call the tlmec with Normal mixed-effects
# out.N <- tlmec(cens,y,x,z,nj,family="Normal",criteria=TRUE)
#
# ## Call the tlmec with Student-t mixed-effects
# out.T <- tlmec(cens,y,x,z,nj,nu=9,family="t",criteria=TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab