Dear All,
I have two groups- intervention and placebo group. Primary outcome is postoperative pain scores assessed with NRS scores during movement at five time points (2h, 6h, 12h, 24h, 48 h).
I would like to calculate the time weighted average or area under the curve up to 48 hours.
I tried in STATA but failed to do with proper command. Currently, I am using STATA version 15.1

thank you in advance.
Asish Subedi


----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(serialno group nrsmove0 nrsmove1 nrsmove2 nrsmove3 nrsmove4)
 1 1 2 3 7 5 3
 2 1 0 0 2 4 5
 3 2 4 6 4 5 3
 4 1 0 0 2 5 2
 5 2 2 2 3 4 7
 6 1 2 6 6 5 2
 7 2 0 3 4 4 3
 8 2 3 3 4 3 6
 9 1 1 1 1 4 2
10 2 1 1 3 6 4
end
------------------ copy up to and including the previous line ------------------