2
$\begingroup$

I am trying to find the correlation between age at onset of diabetes and Body Mass Index of patients. When i performed correlation test in R I get a positive "r" between age and BMI.. but when the same BMI is converted to z-scores I am getting negative correlation. How would interpret this result. Can someone please help.. Following is my results from R

WITH BMI

Call:
lm(formula = age ~ bmi, data = temp)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.3649 -1.8292 -0.2815  1.3361  8.6716 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  5.76891    0.45737  12.613   <2e-16 ***
bmi          0.23689    0.02382   9.944   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.427 on 508 degrees of freedom
Multiple R-squared:  0.1629,    Adjusted R-squared:  0.1613 
F-statistic: 98.89 on 1 and 508 DF,  p-value: < 2.2e-16

WITH BMI Z SCORE

Call:
lm(formula = age ~ z, data = temp)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.4553 -1.9565 -0.1407  1.4838  7.0065 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  10.0316     0.1188  84.433  < 2e-16 ***
z            -0.7271     0.1439  -5.054 6.05e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2.588 on 508 degrees of freedom
Multiple R-squared:  0.04787,   Adjusted R-squared:  0.046 
F-statistic: 25.54 on 1 and 508 DF,  p-value: 6.055e-07

This is the code to calculate Z-score. The code is in PERL

http://pastie.org/10843530

enter image description here

enter image description here

enter image description here

Following is the regression result of log transformed age vs z , actual BMI and gender

lm(formula = log(age) ~ NZ + bmi + gender, data = temp)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.50191 -0.07392  0.01485  0.08512  0.46986 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.731636   0.046103  15.869   <2e-16 ***
NZ          -0.305887   0.010358 -29.532   <2e-16 ***
bmi          0.079247   0.002353  33.681   <2e-16 ***
genderM     -0.022121   0.012759  -1.734   0.0836 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1416 on 506 degrees of freedom
Multiple R-squared:  0.6981,    Adjusted R-squared:  0.6963 
F-statistic:   390 on 3 and 506 DF,  p-value: < 2.2e-16
$\endgroup$
24
  • 1
    $\begingroup$ You should show how you compute z from bmi... or better, re-examine how you compute it, and spot your mistake. $\endgroup$
    – Elvis
    May 19, 2016 at 7:14
  • $\begingroup$ To compute the z scores, I have another reference data set with Age Gender and Body Mas Index (BMI). I computed mean(SD) BMI of Age and gender specific subsets of reference data .. Then subtracted the raw BMI (of my data set) from the computed Mean and then divided by SD. $\endgroup$
    – arshad
    May 19, 2016 at 7:22
  • 2
    $\begingroup$ First: why do you have another data set? Second: the mistake is that you subtract the raw BMI from the mean. This reverses signs. You should do it the other way around: subtract the mean from the raw data. $\endgroup$ May 19, 2016 at 7:42
  • $\begingroup$ @Stephan Kolassa, Thanks for the reply. I use different reference data set for the z score calculation because, my sample has all diabetic patients.. and I need non diabetic healthy people as reference to calculate z-score. And the second : I am very sorry that's a typo .. I actually subtracted the mean from the raw data only.. $\endgroup$
    – arshad
    May 19, 2016 at 7:49
  • 1
    $\begingroup$ Ah, thank you. That makes things a lot clearer. What I'm now not understanding is what you mean by "age and gender matched $z$ scores". Could you perhaps edit your post to include a plot of z against bmi, as well as the specific code you used to calculate z? $\endgroup$ May 19, 2016 at 8:39

1 Answer 1

1
$\begingroup$

I will first address a reformulation of your question, which is statistically relevant: if $\def\cov{\text{cov}}\cov(X_1, X_2) > 0$, $\cov(X_2, Y) > 0$, is it possible that $\cov(X_1, Y) < 0$ ?

The answer is yes, although it can seem counterintuitive. Here is an example of positive definite matrix exhibiting the desired behavior:

> D <- matrix( c(1, 0.2, -0.1, 0, 0.9, 0.3, 0, 0, 0.8), nrow=3 ) 
> D
     [,1] [,2] [,3]
[1,]  1.0  0.0  0.0
[2,]  0.2  0.9  0.0
[3,] -0.1  0.3  0.8
> D %*% t(D)
     [,1] [,2]  [,3]
[1,]  1.0 0.20 -0.10
[2,]  0.2 0.85  0.25
[3,] -0.1 0.25  0.74

So you can have $\cov(X_1, X_2) = 0.2$, $\cov(X_2, Y) = 0.25$ and $\cov(X_1, Y) = -0.1$.

This case corresponds to a situation where

  • $X_1$ has variance $1$,
  • $X_2 = 0.2\> X_1 + \varepsilon$ with $\varepsilon$ independent of $X_1$ and $\def\var{\text{var}}\var(\varepsilon) = 0.9^2$
  • $Y = -0.1 \> X_1 + 0.3 \>\varepsilon + \varepsilon' = -0.16 \> X_1 + 0.3 \> X_2 + \varepsilon'$ with $\varepsilon'$ independent of $X_1, \varepsilon$ and $\var(\varepsilon') = 0.8^2$.

More generally, this will not be possible if $Y$ is independent of $X_1$ conditionally to $X_2$.

Now back to your problem: in your sample, early onset implies high $z$ value (i.e. high BMI for an individual of this age) but low BMI -- well, yes, the younger you are, the lower your BMI (cf this chart for the evolution of the BMI in the age range in your sample). So the (slightly overweight) guys you have in your incident diabetes sample have a BMI correlated with their age. The fact that the younger they are, the chubbier, doesn’t counterbalance this.

I think it could be interesting to try to produce a chart of BMI for incident diabetes cases, as a function of age, and to compare it to the above linked chart. I think this will help to grasp what’s happening in these data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.