Announcement

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

  • problem calculating Cramer's V using tab-command

    dear statalist-users,

    i have a problem calculating Cramer's V for simple 2 x 2 tables using the tabulate-command (tab var1 var2, V). I get a negative value although Cramer's V should be between 0 and 1. I was not able to find an answer on the internet...

    Apart from that i would like to use p-weight when calculating Cramer's V. If I do so (tab var1 var2 [pw=var3], V) STATA says "pweight not allowed". Is it able to use the weight BEFORE calculating Cramer's V if pweight is actually not allowed?

    Thanking you in advance!

    Peter

  • #2
    Originally posted by Peter H. View Post
    I get a negative value although Cramer's V should be between 0 and 1. I was not able to find an answer on the internet...
    It can get negative values in the Stata output in 2x2 tables. I think it's because, in that case, it equals the (absolute value of) Phi coefficient, that's the product-moment (i.e. Pearson's) correlation coefficient in case of binary variables. It treats the two variables as 0 and 1, so the correlation between the two may be either positive or negative. In case, you can just use the "phi" command (type "findit phi" and then look for "snp3 from http://www.stata.com/stb/stb3 STB-3 snp3. Phi coefficient (fourfold correlation)"). Otherwise, you can just ignore the "-" symbol (or, if you prefer, to multiply by "-1").

    I also find it confusing (to get the phi coefficient, you have to ask for Cramer's V; to get Cramer's V, you have to use the "phi" command).

    I'm sorry I don't know the solution to the pweight issue.

    Federico

    Comment

    Working...
    X