2
$\begingroup$

I am using the twins data from OpenMx and am curious to estimate the empirical covariance structure for BMI differences in monozygous and dizygous twins:

library(OpenMx)
data(twinData)
twinData$dz <- as.numeric(twinData$zyg >= 3)

## empirical variance
by(twinData[, c('bmi1', 'bmi2')], twinData$dz, cov, use='complete.obs')
# twinData$dz: 0
# bmi1 bmi2
# bmi1 0.70 0.56
# bmi2 0.56 0.74
# ----------------------------------------------------------------- 
#   twinData$dz: 1
# bmi1 bmi2
# bmi1 0.91 0.41
# bmi2 0.41 0.88

To do this, I restructured the data to a long format with an indicator of dizygous twin group and twin pair ID.

twinData2 <- data.frame(bmi = with(twinData, c(bmi1, bmi2)))
twinData2$dz <- twinData$dz
twinData2$id <- factor(1:nrow(twinData))

Then I fit the following model and found:

summary(fit2 <- lmer(bmi ~ dz + (1 | id) + (0  + dz | id), data=twinData2)) 

...

Random effects:
 Groups   Name        Variance Std.Dev.
 id       (Intercept) 0.4233   0.651   
 id.1     dz          0.0128   0.113   
 Residual             0.4207   0.649   
Number of obs: 7362, groups:  id, 3793

This predicts the BMI variance in dizygous twins to be 0.42 + 0.01 + 0.42 = 0.85 and in monozygous to be 0.84.

Is this calculation correct? Why are these predictions so different from the empirical variance?

$\endgroup$
4
  • $\begingroup$ The covariance of factors is not the same as the random effects in a mixed model. $\endgroup$ Commented Jan 11, 2018 at 0:35
  • $\begingroup$ But I figure I can at least obtain the variance. In particular I note the predicted variance in MZ twins is very high. $\endgroup$
    – AdamO
    Commented Jan 11, 2018 at 1:27
  • $\begingroup$ The covariance in your by function is the standard covariance that we all know. The variance in your random effects is similar but removed from that. As far as I know, the variance of random effects is only useful through variance partitioning methods and model comparison methods. Each twin pair has a linear model with error, so there's a probability distribution associated with that error, it has a mean and variance. $\endgroup$ Commented Jan 11, 2018 at 4:02
  • $\begingroup$ @JaySchylerRaadt Let me put it another way. With $n$ normal RVs with mean 0 and SD 1, the sample mean has SD $1/\sqrt(n)$. If in fact, the $n$ normal RVs were identical variance 1 but had correlation $\rho$. the sample mean has SD $\sqrt{ (1 + (n-1)\rho)/n}$ Right? If so, why isn't it possible to use mixed models to estimate unequal variances in subsamples by imposing an arbitrary mixed effect for compound symmetry correlation? $\endgroup$
    – AdamO
    Commented Feb 12, 2018 at 15:39

0

Your Answer

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