I have a dataset in long format - below is a sample
id | pain-level |
P001_1 | 0.2 |
P001_1 | 0.4 |
P001_1 | . |
P001_1 | 0.6 |
P002_1 | . |
P002_1 | 0.2 |
P002_1 | 0.3 |
P002_1 | 0.5 |
P002_1 | 0.7 |
How would I automatically fill in the missing value as the average of the other pain levels of the same ID?
Thank you.
Wilber
0 Response to Replacing missing datapoint with average of other datapoints with similar id in long format
Post a Comment