I am trying to perform to classify effectiveness of a treatment. Each of the id should contain 4 timeframes.
Dataframe
| id | timeframe | distance |
|---|---|---|
| 1 | 1 | 1.1 |
| 1 | 2 | 1.1 |
| 1 | 3 | 1.2 |
| 1 | 4 | 1.1 |
| 2 | 1 | 1.1 |
| 2 | 2 | 1.1 |
| 2 | 4 | 1.1 |
The question is for example id 2 timeframe #3 is missing. How to create a new row added in the missing timeframe with the average distance value for all the rows with such issue?
I am getting the 'not all time is the same length' when running - Longitudinal clustering using "longitudinal k-means (KML)"