I have a data set containing the trades executed by many traders as follows:
ID Buy(1)/Sell(0) StartTime EndTime PnL 1 1 1 1 7 1 1 2 3 5 1 0 2 5 6 1 1 3 5 -4 2 1 1 3 8 2 0 2 2 -9 2 0 3 5 3
ID is the trader's identification number,
Buy(1)/Sell(0) indicates whether the trade was a buy or sell, for simplicity
EndTime are the day on which the trade was opened and closed, and
PnL is the profit or loss from that trade.
My goal here is to study whether a trader closes his position earlier (i.e. duration of a trade) based on whether he has made a gain or a loss.
I am very new to the concept of hazard models. I understand the main idea behind them, but I am not sure what is the correct model to apply in my case where I have several traders, each with multiple trades that have different entry times (
I would greatly appreciate any help you can provide me, with as much detail as possible.
UPDATE: How would the model specification differ if the transactions in my data are considered to be correlated? I am using R.