Hello,
My data looks like this:
Each t represents one quarter and t goes from 1 to 40, thus periods 1 to 4 make the first year and 37 to 40 make year ten.
Whenever a firm (i.e., id) disappears from the dataset, I have a ".".
My questions are regarding two things:
Firstly, I need to create a variable sigma for annualized rolling standard deviation of returns. I am having trouble doing this. All the solutions I have found so far are for cases when people have the date (e.g. "31Jan2013") in t. I honestly have no idea which functions should I use here.
Secondly, the point of my study is to see if my variables impact the probability of bankruptcy in the next period, and this probability follows a logistic distribution.
I am not sure how to do this. So, by parts:
My data looks like this:
id | t | bankruptcy_dummy | income | return |
1 | 1 | 0 | 0.5 | 0.1 |
1 | 2 | 0 | 0.7 | 0.13 |
1 | 3 | 1 | . | . |
1 | 4 | . | . | . |
1 | 5 | . | . | . |
1 | ... | . | . | . |
2 | 1 | 0 | 0.78 | 0.2 |
2 | 2 | 0 | 0.34 | 0.24 |
2 | ... | 0 | ... | ... |
Whenever a firm (i.e., id) disappears from the dataset, I have a ".".
My questions are regarding two things:
Firstly, I need to create a variable sigma for annualized rolling standard deviation of returns. I am having trouble doing this. All the solutions I have found so far are for cases when people have the date (e.g. "31Jan2013") in t. I honestly have no idea which functions should I use here.
Secondly, the point of my study is to see if my variables impact the probability of bankruptcy in the next period, and this probability follows a logistic distribution.
I am not sure how to do this. So, by parts:
- By executing gen bnkr1 = bnkr[_n+1] I would get Yt+1? Or should I somehow do the opposite and lag my explanatory variables?
- Then, could I create a vector x by executing global xlist income return sigma
- Then how do I build the probability? I know it follows a logistic distribution, so I guess I would use logit(xlist) maybe?
- Finally, how do I regress considering this probability? reg bnkr1 xlist wouldn't take into account this logistic distribution...
Comment