Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Annualized standard deviation from quarterly data and logistic distribution for probability of Yt+1

    Hello,

    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 ... ...
    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.

    Click image for larger version

Name:	prob.JPG
Views:	2
Size:	11.1 KB
ID:	1417164


    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...
    Thank you in advance!
    Last edited by Sofi Gomes; 05 Nov 2017, 09:01.

  • #2
    Update:

    I still haven't managed the rolling standard deviation, but I tried the logit regression bit and got all failures, so I would really appreciate some help regarding in what I might have failed.

    I did the following:
    • gen bnkr1 = bnkr[_n+1]
    • then global id id
    • global t t
    • global ylist bnkrq
    • global xlist income (other indep variables)
    • then sort $id $t
    • xtset $id $t
    • xtdescribe
    • xtsum $id $t $ylist $xlist
    • and finally logit $ylist $xlist

    Comment

    Working...
    X