Announcement

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

  • Correlation Index by Cerquira and Martins (2009)

    Dear all,
    I am trying to calculate the CI by Cerquira and Martins (2009) at the moment but it does not really work. The suggested formular looks like this:
    Click image for larger version

Name:	CI.png
Views:	1
Size:	40.0 KB
ID:	1704728



    where i= country i and j= country j t: point in time T. Can someone suggest a code how I can calculate this for the countries DE and IT?

    I have tried the following but invalid occurs:

    egen DE_mean = mean(DE)
    egen BE_mean = mean(BE)
    egen DE_sd = sd(DE)
    egen BE_sd = sd(BE)

    gen CI_DE_BE = .
    . forvalues i = 1/`=_N'-1' {

    . local sum_num = sum((DE[`i'+1..] - DE_mean)*(BE[..`=(_N'-1'-`i')] - BE_mean))

    . local denom = DE_sd * BE_sd * (`=_N'-`i')

    . replace CI_DE_BE = `sum_num' / `denom' if CI_DE_BE == .

    . }

    Thank you very much in advance for your help! I really appreciate it!
    Kind Regards Tizian
    Last edited by Tizian Di; 07 Mar 2023, 08:32.

  • #2
    spitballing
    Code:
    center DE BE
    egen DE_sd = sd(DE)
    egen BE_sd = sd(BE)
    di 1-0.5*(c_DE/DE_sd - c_BE/BE_sd)
    Last edited by George Ford; 07 Mar 2023, 11:33.

    Comment

    Working...
    X