Announcement

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

  • Help with Correlation

    Hello
    I have been trying to get the Descriptive Statistics and Correlation Table for my data set panel.
    The descriptive statistics using the command: summarize comes out perfectly

    My main issue is with the command correlate and/or pwcorr (i have used both) with one variable in particular: democracy

    The democracy variable is either 1 or 0 signifying if a country has been classified as a democratic country or not in a particular year.
    The variable has 3 more subsets:
    dhigh - High Level Democracy
    dmid - Mid Level Democracy
    dlow - Low Level Democracy

    The levels are based on the Freedom House Index.
    Like the democracy variable the others are also either 1 or 0 signify the democratic level of the country in a particular year.

    My problem is that when run correlation with other variables democracy and its subsets always have "."
    Ex.

    code: correlate loggdp logtrade polrisk popgrow govsp democracy ***pwcorr was used also


    Result:
    loggdp logtrade polrisk popgrow govsp democr~y

    loggdp 1.0000
    logtrade -0.4361 1.0000
    polrisk 0.0796 0.1502 1.0000
    popgrow -0.2165 -0.1561 -0.1381 1.0000
    govsp -0.2327 0.2970 0.0588 -0.0700 1.0000
    democracy . . . . . .

    So the same thing happens for the aforementioned subsets (dhigh, dmid, dlow) when I want to find their own correlation.
    Something of note I should mention. When I run the correlation of democracy with its subsets, the stata program returns values for the subsets,
    but not for the democracy variable. Any help will be much appreciated.
    Thank you






  • #2
    If a variable is constant (in your situation always 0 or always 1) then its variance and its SD are both zero and any correlation involving that variable is undefined or indeterminate, as you’re dividing by zero in any standard recipe for calculating correlation

    This isn’t a problem to be solved. It is just the way correlation works. I am not clear that producing lots of correlations for different subsets will help you much, but Stata is not being awkward here, still less wrong.

    Comment


    • #3
      ok... I had a feeling it was something like this....
      Thank you Nick

      Comment

      Working...
      X