[R-meta] FW: R-sig-meta-analysis Digest, Vol 89, Issue 13

Viechtbauer, Wolfgang (NP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Dec 6 12:15:16 CET 2024


For some reason, some of my posts do not seem to get through. Not sure if they are getting caught in some spam filter. I am going to try sending this again. Apologies for the noise in case the message below (which was sent almost 2 hours ago) does finally show up on the list.

Best,
Wolfgang

-----Original Message-----
From: Viechtbauer, Wolfgang (NP)
Sent: Friday, December 6, 2024 10:28
To: St Pourcain, Beate <Beate.StPourcain using mpi.nl>; R Special Interest Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
Subject: RE: R-sig-meta-analysis Digest, Vol 89, Issue 13

I assume you are referring to model 'model0r.mlcon' below and coef(model0r.mlcon)[1] is the DZ coefficient (i.e., the estimated average r-to-z transformed ICC) and coef(model0r.mlcon)[2] the MZ coefficient and vcov(model0r.mlcon) gives the corresponding var-cov matrix. Then

res <- deltamethod(model0r.mlcon, fun=function(z1,z2) c(tanh(z1), tanh(z2)))
res

will give you the back-transformed estimates (i.e., estimated ICCs) with corresponding SEs and CIs and

res$vcov

is the full var-cov matrix of these back-transformed estimates. And

deltamethod(model0r.mlcon, fun=function(z1,z2) 2*(tanh(z2)-tanh(z1)))

will give you the estimated H^2 based on Falconer's formula with corresponding SE/CI.

Best,
Wolfgang

> -----Original Message-----
> From: St Pourcain, Beate <Beate.StPourcain using mpi.nl>
> Sent: Tuesday, December 3, 2024 19:47
> To: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer using maastrichtuniversity.nl>; R
> Special Interest Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
> Subject: RE: R-sig-meta-analysis Digest, Vol 89, Issue 13
>
> Dear Wolfgang,
>
> Many thanks for your advice and sorry about the delay.
> I added my answers below! Most things are sorted and clear! However, I did not
> follow your reply about the back-transformation of the directly estimated
> co/variance for fixed effects, i.e. from the rZ to the r the level, using the
> deltamethod. I can see how you derive the SE for the fixed effects at the back-
> transformed level with deltamethod, but not the variance and covariance. Could
> you please help here?
>
> Many thanks,
> Beate
>
> -----Original Message-----
> From: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
> Sent: Monday, November 11, 2024 4:13 PM
> To: St Pourcain, Beate <Beate.StPourcain using mpi.nl>; R Special Interest Group for
> Meta-Analysis <r-sig-meta-analysis using r-project.org>
> Subject: RE: R-sig-meta-analysis Digest, Vol 89, Issue 13
>
> Dear Beate,
>
> Some brief comments from my side to your questions below.
>
> Best,
> Wolfgang
>
> > -----Original Message-----
> > From: St Pourcain, Beate <Beate.StPourcain using mpi.nl>
> > Sent: Tuesday, November 5, 2024 19:16
> > To: Viechtbauer, Wolfgang (NP)
> > <wolfgang.viechtbauer using maastrichtuniversity.nl>; R Special Interest
> > Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
> > Subject: RE: R-sig-meta-analysis Digest, Vol 89, Issue 13
> >
> > Dear Wolfgang,
> > We have taken the project a few steps further now following
> vanhouwelingen2002.
> > Thanks for all your advice! However, bivariate models have of course a
> > slightly different structure compared to nested models that we usually
> > use and we have transformations and multiple random effects. Thus, we
> > had a few questions.  We have a model like this:
> >
> > Study_ID: Unique ID for each independent cohort
> > ESID_code: Unique ID for study-specific assessment coded as nested
> > within each study (following Austerberry)
> > MZDZ: MZ coded 1, DZ coded 0
> > zi and vzi: Z transformed correlations and their variance
> >
> > model0r.mlcon <- rma.mv(
> >   zi,
> >   vzi,
> >   random = list(~ MZDZ_factor | Study_ID, ~ MZDZ_factor | ESID_code),
> > struct="UN",
> >   data = data,
> >   mods = ~ 0 + MZDZ_factor,
> >   method = "ML",
> >   tdist = TRUE,
> >   cvvc="varcov",
> >   control=list(nearpd=TRUE))
> >
> > 1)    We changed now from REML to ML to allow for model building with fixed
> > effects. Is there any major drawback?
>
> Unless your sample sizes are small, the difference between ML and REML should be
> negligible. For model selection including fixed effects, ML is the sensible
> choice.
>
> R: Perfect. Thank you!
>
> > 2)    What would be the best way to estimate I2 for each MZ and DZ group using
> Z
> > and the raw correlations? (We have an idea how to do this with nested
> > models but not for bivariate models).
>
> Maybe this is useful:
>
> https://www.metafor-
> project.org/doku.php/tips:i2_multilevel_multivariate#multivariate_models
>
> R: Very helpful, thank you!
>
> > Also does it make sense to estimate heterogeneity in rZ as:
> >
> > tau_het<-round(model0r.mlcon$tau2[1] + model0r.mlcon$tau2[2] -
> > 2*model0r.mlcon$rho*sqrt(model0r.mlcon$tau2[1]*model0r.mlcon$tau2[2]),
> > 3)
> >
> > gamma_het<-round(model0r.mlcon$gamma2[1] + model0r.mlcon$gamma2[2] -
> > 2*model0r.mlcon$phi*sqrt(model0r.mlcon$gamma2[1]*model0r.ml$gamma2[2])
> > , 3)
> >
> > res_het<-tau_study + gamma_type
>
> I can't answer that because you would first have to define what you mean by
> 'residual heterogeneity'.
>
> R: We aimed to estimate the heterogeneity in rZ-scores, analogous to the
> bivariate example approach (but now with two random effects)
> https://www.metafor-project.org/doku.php/analyses:vanhouwelingen2002
>
> > 3)    We can estimate the SE for the raw scores
> > rDZse<- deltamethod(~ (exp(2*x1) - 1) / (exp(2*x1) + 1),
> > coef(model0r.mlcon),
> > vcov(model0r.mlcon))
> > rMZse<- deltamethod(~ (exp(2*x2) - 1) / (exp(2*x2) + 1),
> > coef(model0r.mlcon),
> > vcov(model0r.mlcon))
> > Is there an option to backtransform vcov(model0r.mlcon) from the
> > modelled rZ to raw r scores? Especially we are interested in the
> > covariance for raw r to derive a correlation between raw rMZ and rDZ,
> including SE.
>
> The deltamethod() function from metafor can give you the full back-transformed
> var-cov matrix.
>
> R: Sorry for being slow here, I do not know how to proceed. The variance
> covariance matrix is directly estimated and there is not transformation
> involved.  Could you please advise
>
> > 4)    For adding further covariates as fixed effects, we were wondering how to
> > best predict manually rMZ and rDZ for different levels of the
> > covariate e.g. age
> >
> > model.age.r.mlcon <- rma.mv(
> >   zi,
> >   vzi,
> >   random = list(~ MZDZ_factor | Study_ID, ~ MZDZ_factor | ESID_code),
> > struct="UN",
> >   data = data,
> >   mods = ~ 0 + MZDZ_factor + MZDZ_factor:I(Age -24), #age centered at 24 years
> >   method = "ML",
> >   tdist = TRUE)
> > model.age.r.mlcon snippet
> >
> >                             estimate      se    tval  df    pval
> > MZDZ_factor0                0.7264  0.1201  7.7141  78  <.0001
> > MZDZ_factor1                1.3193  0.2464  6.1661  78  <.0001
> > MZDZ_factor0:I(Age - 24)    0.0160  0.0040  4.0432  78  0.0001
> > MZDZ_factor1:I(Age - 24)    0.0276  0.0038  7.2905  78  <.0001
> >
> > We could now predict the twin correlations at different ages using the
> > predict function (and did this). However, this does not help with the
> > deltamethod. Is there a more elegant way to estimate the SE?
> > e.g.
> > age.20 <- -4
> > rDZ_20 <-(exp(2*(model.age.r.mlcon$b[1] +
> > model.age.r.mlcon$b[3]*age.20)) - 1) / (exp(2*(model.age.r.mlcon$b[1]
> > + model.age.r.mlcon$b[3]*age.20)) + 1)
> >
> > rMZ_20 <-(exp(2*(model.age.r.mlcon$b[2] +
> > model.age.r.mlcon$b[4]*age.20)) - 1) / (exp(2*(model.age.r.mlcon$b[2]
> > + model.age.r.mlcon$b[4]*age.20)) + 1)
> >
> > rDZ_20.se <-deltamethod(~(exp(2*(x1 + x3*age.20)) - 1) / (exp(2*(x1 +
> > x3*age.20)) + 1), coef(model.age.r.mlcon), vcov(model.age.r.mlcon))
> >
> > rMZ_20.se <-deltamethod(~(exp(2*(x2 + x4*age.20)) - 1) / (exp(2*(x2 +
> > x4*age.20)) + 1), coef(model.age.r.mlcon), vcov(model.age.r.mlcon))
>
> I don't understand the question. What do you mean by 'more elegant'?
> R: No worries, we will sort this out. I just meant a "shorter" way, but this is
> not a problem.
>
> > Many thanks again for all your help,
> > Beate



More information about the R-sig-meta-analysis mailing list