This function is used internally in jointmeta1. It takes longitudinal
and survival datasets, and orders them by increasing survival time.
sortDat(longdat, survdat, longdat2, survdat2)longitudinal dataset with factor variables and interaction terms expanded out
survival dataset with factor variables and interaction terms expanded out
longitudinal dataset with original variables
survival dataset with original variables
a list containing four ordered versions of the inputted datasets. In
the output long.s is the the ordered version of longdat,
surv.s is the ordered version of survdat, long.s2 is
the ordered version of longdat2, and surv.s2 is the ordered version
of survdat2.