data_preparation function

Prepare data for the sequence of emulated target trials