Announcement

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

  • Correlation between variables over time in panel data

    How do I go about displaying the change in correlation between two variables over time? I have a panel dataset with 30 years and several thousand firms. I would like to display graphically the change in the relationship between borrowing and investment over time. Many thanks!

  • #2
    With that many companies you could calculate the instantaneous correlation, some lagged correlation, a correlation pooling results in some moving time window, and so on and so forth.

    Without any pretence on my part that this makes economic or financial sense, here is an example using rangestat from SSC to show technique:

    Code:
    . webuse grunfeld, clear
    
    . rangestat (corr) mvalue kstock, int(year 0 0)
    
    . tabdisp year, c(corr_*)
    
    ------------------------------------------------------
         Year |            corr_nobs                corr_x
    ----------+-------------------------------------------
         1935 |                   10            -.24964919
         1936 |                   10            -.13778091
         1937 |                   10             .22234782
         1938 |                   10             .38337192
         1939 |                   10             .30699455
         1940 |                   10              .2418253
         1941 |                   10             .32405812
         1942 |                   10             .40219129
         1943 |                   10             .26078395
         1944 |                   10             .06473613
         1945 |                   10             .11464911
         1946 |                   10             .27747902
         1947 |                   10              .6398159
         1948 |                   10             .69484476
         1949 |                   10             .74271262
         1950 |                   10             .74092512
         1951 |                   10              .7555348
         1952 |                   10             .82361111
         1953 |                   10             .88239901
         1954 |                   10             .89396833
    ------------------------------------------------------
    .

    Comment

    Working...
    X