Skip to main content
. Author manuscript; available in PMC: 2016 Aug 26.
Published in final edited form as: Methods Rep RTI Press. 2016 Feb;2016:MR-0033-1602. doi: 10.3768/rtipress.2016.mr.0033.1602
# illustrate individually varying times
# of observation
y <− matrix(sample(1:5, 500,
replace=TRUE), 100, 5)
t <− matrix(runif(600, 1, 3), 100, 6)
times <− cbind(t[,1], t[,1]+t[,2],
    t[,2]+t[,3],
    t[,3]+t[,4],
    t[,4]+t[,5])
endt <− t[,6]
lc <− longCat(y, times=times, endt=endt)
par(mfrow=c(1,1), bg='cornsilk3',
mar=c(5.1, 4.1, 4.1, 10.1), xpd=TRUE)
cols <− longCatPlot(lc, legendBuffer=0,
  groupBuffer=0,
  main='Individually Varying Times
  of Observation')
legend(7.5, 100, legend=lc$factors,
lty=1, col=cols, lwd=2)
par(bg='transparent',
mar = c(5, 4, 4, 2) + 0.1, xpd=FALSE)