MCMCglmm: ixn between binary family-level factor and us() random effect
Hi Jarrod, If speed is the only problem I can tolerate it - the wait is more than outweighed by the advantages of using MCMCglmm. The slowest model I'm running (the one fitting an unstructured 4x4 covariance matrix in each of two groups) gives >1000 independent samples in 3-4 hours, which is fine as I only have to do one full run, and all the other models can be run in parallel with this one. Presumably if time was really a problem, I could run the same model several times in parallel and merge the MCMC output, as long as each run had enough burnin. I've now compared the correlations estimated in MCMCglmm from a similar model to the one below (4x4 family VCV in a single group, mother and father residuals fixed to zero) with correlations estimated using FISHER and they are similar enough to reassure me that they're measuring the same thing. I hope that's all my problems solved - thank you for all your help with this. Cheers, Paul -----Original Message----- From: Jarrod Hadfield [mailto:j.hadfield at ed.ac.uk] Sent: 07 February 2011 09:23 To: Paul Johnson Cc: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] MCMCglmm: ixn between binary family-level factor and us() random effect Hi Paul, Unfortunately fixing residual variances to zero (or close to) is not going to work in MCMCglmm because mixing will become intolerably slow. As you say, you can fix the variance to zero in the G-structure but this also fixes the covariances within the sub-matrix to zero, so as yet there is no satisfactory solution in MCMCglmm. Sorry. I'm pretty confident a SIR model could be constructed that would fit the model, but a the moment the SIR implementation is so rudimentary it will not run on all data (e.g. if there are missing data such as that associated with phantom parents). Cheers, Jarrod
On 7 Feb 2011, at 00:51, Paul Johnson wrote:
Hi Jarrod,
Thanks again, for the syntax and for the modelling advice.
I think (hope) I can answer some of your concerns about my model,
particularly about the residual and family-level variances being
confounded. In the most general model I'm specifying 8 separate
variances, for mothers, fathers, daughters and sons at the within-
family (R) and between-family (G) levels:
random=~us(fampos.f):famid,
rcov=~idh(fampos.f):units,
There's only one mother per family so individual level = family
level and two variances can't be estimated. The same applies to
fathers. For both mothers and fathers the variance at one level has
to be fixed at (close to) zero:
R=list(nu=nu,V=diag(c(V,V,0.0001,0.0001)),fix=3)
# the variances on the diagonal are for daughters, sons, mothers,
fathers
I didn't think it mattered which of the R or G variances was fixed
(unless the R and G priors differ?). I chose to fix the R variance
because I don't know how to fix the variances in the G structure
without also fixing the covariances that fall within the partition
(in MLWIN it makes no difference which is fixed). I calculate the
overall 4x4 covariance matrix by adding the daughter and son
residual variances to their family variances and converting to a
correlation matrix (for each row of the MCMC output).
I'm not totally confident about this method but I've used it for a
previous analysis in MLWIN - this gave sensible estimates for family
correlations which I replicated by regressing offspring z-scores on
parent z-scores. I haven't yet had time yet to check the MCMCglmm
results from the current analysis in a similar way - you might save
me the trouble by telling me it's invalid.
Cheers,
Paul
PS Here's the call to MCMCglmm:
MCMCglmm(
fixed=fixed.form,
rcov=~idh(fampos.f):units,
random=~us(fampos.f):famid,
data=mfs.fam,nitt=nitt,thin=thin,burnin=burnin,
prior=
list(
R=list(nu=nu,V=diag(c(V,V,0.0001,0.0001)),fix=3),
G=list(G1=list(nu=nu,V=diag(V,4)))))
levels(mfs.fam$fampos.f)
[1] "Daughter" "Son" "Mother" "Father"
________________________________________ From: Jarrod Hadfield [j.hadfield at ed.ac.uk] Sent: 05 February 2011 10:49 To: Paul Johnson Cc: r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] MCMCglmm: ixn between binary family-level factor and us() random effect Hi Paul, random = ~us(at.level(asthm,1):offpar.f):famid+us(at.level(asthm, 2):offpar.f):famid Does what you want, but I would think hard about what the terms in us(offpar.f):famid mean. For example the diagonals of the 3x3 covariance matrix are the mother, father and offspring variances, but only the last variance can be uniquely estimated with all residual structures (because there are multiple offspring but only a single mother and a singe father within a family). For example, these varances would could not be uniquely estimated if gender specific residual variances were fitted, and would be partially confounded in your case where you estimate a common variance across offspring and both parents. The off-diagonals (assortative mating, mother-offspring, father-offspring covariances) can be uniquely estimated but it would make much more sense to do this at the residual or phenotypic level. You could probably do it using SIR models but I have not documented or tested them yet. You could try some of the SEM models used by people studying human genetics. I believe Mx is widely used, and if you can get hold of an accompanying book "Methodology for Genetic Studies of Twins and Families" (1996) by Neale, it is excellent. Cheers, Jarrod Quoting Paul Johnson <Paul.Johnson at glasgow.ac.uk>: I'm fitting models to estimate mother-father and parent-offspring covariances, using random = ~us(offpar.f):famid where offpar.f is a factor with 3 levels: offspring, mother, father and "famid" is the family ID. This allows me to compare the strengths of mother-offspring and father-offspring correlations within familes. The next step is to compare these covariances between asthma families (AF) and non-asthma families (NAF). I.e. I want to estimate three covariances within each level of the NAF/AF factor while setting the covariances between NAF and AF families to zero. The structure of the 6x6 covariance matrix should be VAF 0 0 VNAF where VAF and VNAF are 3x3 US covariance matrices and the 0s are 3x3 blocks of zeros. How can I specify this in a formula? I've tried various random formulae based on what I found in the MCMCglmm course notes and this list but with no success. Thanks for any help, Paul The University of Glasgow, charity number SC004401 _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. The University of Glasgow, charity number SC004401
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. The University of Glasgow, charity number SC004401