Announcement

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

  • Correlation between two variables - Different cases

    Hello,
    I need guidance with the following. I am trying to find correlation between two variables. I know I can use pwcorr if the variables are both continuous. I am thinking I should ttest if one variable is continuous and one in binary ( diff in means) and use chisquared if they both are binary. Is this acceptable? Thanks

  • #2
    You can use the Pearson correlation coefficient (which is what -pwcorr- calculates) regardless of the type of variable. If you are also interested in significance testing, then the p-values calculated by -pwcorr- are valid in small samples if one or both variables is normally distributed, and in large samples more or less regardless of the distributions, including one or both being dichotomous.

    If you are truly looking for some kind of correlation coefficient when one or both of the variables is dichotomous or ordinal, you can also use polychoric correlations. Those are available with polychoric.ado, written by Stas Kolenikov and available from SSC. Or for correlations among pairs of dichotomous variables, there is the official Stata command -tetrachoric- (which should produce the same results as -polychoric- when applied to pairs of dichotomous variables; -polychoric- is more general.)

    But if you are just looking for measures of the strength of association, not necessarily correlation coefficients, then it is probably more conventional to handle a continuous and dichotomous predictor by looking at the mean difference across levels of the dichotomous variables (which, if you are looking for a significance test, would be handled with a t-test). Similarly, for pairs of dichotomous variables, the strength of association can be expressed as a risk ratio or odds ratio or risk difference. See -help epitab- for commands that calculate these statistics, and also can give you chi square tests of statistical significance.

    Comment


    • #3
      Thanks very much.

      Comment

      Working...
      X