Hi,

I have fitted a multi trajectory model using the user written command traj. Downloadable from (https://www.andrew.cmu.edu/user/bjones/example.htm). It is a subset of finite mixture modeling and it uses an Expectation-Maximization algorithm to calculate likelihood, BIC, AIC. It is used to get trajectories of similar developments of a outcome over time (in my case organ failure in the intensive care unit). A way of longitudinal clustering. I have fitted a model with 5 trajectories using 600 of my 660 patients. After successful model estimation you will get Posterior Probabilities of Group Membership (PPGM) for all patients used in model building, i.e. a probability of trajectory group membership which is based on their individual outcome trajectory. In my case 600 patients assigned according to their PPGM to trajectory groups 1-5.

I would now like to test my model using the 60 out-of sample patients. The command traj saves (amongst other things)
coefficient vector in ​​​​e(b) and variance-covariance matrix of the estimators in ​​​​​​e(V). I just do not know how to use the estimated coefficients (or something else) to predict trajectory group membership (or to be more precise, predict PPGM:s) for the out-of sample patients.


These are the coefficients for the model (however simply using predict efter model estimation does not seem to work):
Code:
mat list e(b)
e(b)[1,93]
    intercG1M1  linearG1M1  quadraG1M1  intercG2M1  linearG2M1  quadraG2M1
y1  -.24828183    .0957084  -.18756259   .94245807   .15709564  -.01689182

    intercG3M1  linearG3M1  quadraG3M1   cubicG3M1  intercG4M1  linearG4M1
y1   .47850806   .41861559  -.11403015   .00434383   4.8893951  -.14670883

    intercG5M1  linearG5M1     sigmaM1  intercG1M2  linearG1M2  intercG2M2
y1   2.8395839  -.08377488   1.7084579  -1.9743456  -1.0622643  -1.7178047

    linearG2M2  quadraG2M2  intercG3M2  linearG3M2  quadraG3M2  intercG4M2
y1   .19386034  -.01960231  -2.9482756   .28555771  -.07082197  -1.7504799

    linearG4M2  intercG5M2  linearG5M2  quadraG5M2     sigmaM2  intercG1M3
y1  -.23470341   1.0383231   .47755237  -.03152176   2.5935315   1.1313146

    linearG1M3  quadraG1M3  intercG2M3  linearG2M3  intercG3M3  linearG3M3
y1  -.02527667  -.30855228   3.9644703  -.37858437   3.3076506  -.40766561

    quadraG3M3  intercG4M3  linearG4M3  intercG5M3  linearG5M3  quadraG5M3
y1  -.04323597   4.8143053  -.27388504   5.8055347  -.53495029   .02150391

       sigmaM3  intercG1M4  linearG1M4  intercG2M4  linearG2M4  quadraG2M4
y1   2.0796368  -.18207435  -.77078781  -1.3592468   .29705347  -.02165018

    intercG3M4  linearG3M4  quadraG3M4  intercG4M4  linearG4M4  quadraG4M4
y1  -1.0767241   .22194989  -.04113865    -.952448   .16721562  -.01153703

    intercG5M4  linearG5M4  quadraG5M4     sigmaM4  intercG1M5  linearG1M5
y1  -.40631714   .48732439  -.02192546   1.7242394  -1.3547466   1.5372866

    quadraG1M5  intercG2M5  linearG2M5  quadraG2M5  intercG3M5  linearG3M5
y1  -.40166623   1.0632533  -.12456124  -.01900371   -.2377571   .80695618

    quadraG3M5  intercG4M5  linearG4M5  quadraG4M5  intercG5M5  linearG5M5
y1   -.1548212  -.22852551   .53338764  -.10662458   1.5454625   .06741163

    quadraG5M5     sigmaM5  intercG1M6  linearG1M6  quadraG1M6  intercG2M6
y1  -.02318965   1.3083379    1.384895   .22452482   -.2026116   2.1075309

    linearG2M6  quadraG2M6  intercG3M6  linearG3M6  quadraG3M6  intercG4M6
y1   .14149251  -.01543762   1.7952867   .23408158  -.05830794   2.0573176

    linearG4M6  quadraG4M6  intercG5M6  linearG5M6     sigmaM6    mthetaG2
y1   .10300466  -.00803982   2.7987022   -.0460269   1.0136497  -1.2123054

      mthetaG3    mthetaG4    mthetaG5
y1  -.79020097  -1.1170229  -2.0183256

. predict trajectory_group_hat
variable intercG1M1 not found

I am new to prediction models, since this is a user-written command most guides and helpfiles does not bring me any closer to a solution. If anyone needs more info on my dataset, code for traj command or anything else please ask. I tried to keep the first post somewhat limited because I am uncertain on what information necessary for a solution.
Any ideas would be much appreciated.

All the best,


Jesper Eriksson, Stockholm, Sweden.