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

Comment