# total variability/pattern analysis of multivariate longitudinal data for each subject

I have information regarding 80 metabolomics measurements for 3 individuals who had a treatment (two of them are alive at the end of the study, one is dead).

Patient Time Metabolite1 Metabolite2
1 10 nov 1.07 0.4
1 11nov 2.05 0.86
1 12 nov 0.76 0.5
... ... ... ...
2 8 nov 2.1 1.01
... ... ... ...

Moreover, all data are measured longitudinally (2 alive patients have 7 and 12 data points measured (some time points do not overlap), while the dead patient has around 50 longitudinal measurements (as he stayed in treatment longer).

The idea is to compare the total variability among them or find patterns which would distinguish the subjects (alive/dead). But does it make sense given the second patient stayed longer? If yes, what are the techniques (given such a small sample size, this can be something as an index of variability for each individual)?

I tried using beta diversity metric (Anderson et al. 2006), which showed greated variability of the data for the third (dead) patient. However, when i reduced the sample size to take same number (seven) for each patient, i got (i) same variability between groups when time points are taken together for the 3rd (dead) patient (say from 30th to 37th) (ii)higher variability when we take randomly seven observations (beginning of the month/middle/end), which i guess makes sense as we expect points which are measured more closely to be more correlated).

The first problem is having only 3 individuals, with only 1 dying. It's essentially impossible to get reliable results in this situation. A pattern that is equally likely between those who will die and those who are cured would still have a 1/8 chance, $$(\frac{1}{2})^3$$, of being seen only in the individual who died. So it will be impossible to get anything reliable with such a small data set. What follows assumes that you will be continuing such studies on enough individuals to get reliable results.

The second problem comes from the different number of observations depending on whether an individual died. I infer that you have observations on patients while they are in a hospital or other facility, but once they are cured and released you have no further data on them.

In the context of survival analysis, if you think of the "event" as being released from the hospital, you have a situation related to survivorship bias. The fact of not being released from the hospital provides information not available for those who were.

If you want to build a predictive model to distinguish who will recover and be released from those who won't, you could focus on the values at times before anyone could reasonably be expected to be released. I would focus on the times of the observations from the starting point, rather than the number of observations evaluated per se. I don't think that you should be using data on the patient who died at very late times (e.g., the 30th to 37th observations) for which there are no corresponding observations for the others.

Alternatively, there are established ways to model longitudinal data (related to your metabolites over time) along with time-to-event data. This search can point you in that direction.

Third, it's not clear from the question exactly how you applied beta diversity to your data. I haven't thought through how well that measure, developed for species composition diversity among sites within a region, would apply to this type of metabolic data. If there is precedent in the metabolomics literature I suppose it would be OK, but do look at the cautions about beta diversity noted by Ricotta in Ecol Evol. 2017 Jul; 7(13): 4835–4843.

Fourth, before you jump to exploring measures of diversity as a predictor, make sure that simple measures of metabolite levels don't work adequately. Measures of diversity typically require a large number of observations in order to get reliable estimates than do measures of levels. At first glance, at least, Pinto-Plata et al., Respir Res. 2019 Oct 15; 20(1):219 seems to be a good example of how you can combine information on metabolite levels with survival analysis.

• many thanks for the detailed answer! very appreciated. Mar 25 at 7:24