[R-meta] Estimate variance from time series data
Viechtbauer, Wolfgang (SP)
wolfg@ng@viechtb@uer @ending from m@@@trichtuniver@ity@nl
Wed Aug 22 11:34:14 CEST 2018
Dear Arne,
You need to install the 'devel' version of metafor:
https://wviechtb.github.io/metafor/#installation
Best,
Wolfgang
-----Original Message-----
From: Arne Janssen [mailto:arne.janssen using uva.nl]
Sent: Tuesday, 21 August, 2018 22:58
To: Viechtbauer, Wolfgang (SP)
Cc: r-sig-meta-analysis using r-project.org
Subject: Re: [R-meta] Estimate variance from time series data
ATTACHMENT(S) REMOVED: Dados.xlsx
Dear Wolfgang,
Sorry to bother you again. I'm following your advice and trying to run a
meta-analysis with repeated measures using rma.mv(). In this document
(https://wviechtb.github.io/metafor/reference/rma.mv.html) you recommend
using struct="CAR" when time points are not evenly spaced, which is my
case. However, specifying this structure results in the error message
"Unknown 'struct' specified". Struct="AR" does work. I am using metafor
package version 2.0-0 for R for windows.
My data have the following structure:
> head(dados)
Study ID NE Time N.contr. N.treat. Xc Xt Sc St
1 A Aa y 0.00000000 4 4 258.00 250.50 153.4927 87.895772
2 A Aa y 0.07142857 4 4 247.25 145.50 216.2736 106.753610
3 A Aa y 0.14285714 4 4 150.25 71.50 108.8252 42.618462
4 A Aa y 0.50000000 4 4 254.50 54.75 230.6115 51.893320
5 A Aa y 1.00000000 4 4 213.75 15.75 204.2945 4.573474
6 A Aa y 1.42857143 4 4 195.25 22.75 152.6376 13.073510
>
The original data are population dynamics of different organisms, which
all have received a treatment and a control. I have attached an Excel
file with a subset of my data, consisting of three different studies
(A-C), each with a few independent time series, which serve as ID (Aa,
Ab, Ba, Bb, etc.). The final data set will have many more time series
and more modifiers.
The time intervals of the different series are not equal and are scaled
to to generation time of the different organisms.
With the attached dataset, I ran the following analysis:
>
dat1<-escalc(measure="SMD",n1i=N.treat.,m1i=Xt,sd1i=St,n2i=N.contr.,m2i=Xc,sd2i=Sc,
data=dados)
> rma(yi,vi,data=dat1)
Random-Effects Model (k = 102; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.6514 (SE = 0.1967)
tau (square root of estimated tau^2 value): 0.8071
I^2 (total heterogeneity / total variability): 47.00%
H^2 (total variability / sampling variability): 1.89
Test for Heterogeneity:
Q(df = 101) = 240.2426, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.9757 0.1192 -8.1855 <.0001 -1.2093 -0.7421 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
So far so good. Now, I want to use a modifier and use an autocorrelation
structure:
> rma.mv(yi,vi, mods=~NE, random=~Time|ID, struct="AR", data=dat1)
Multivariate Meta-Analysis Model (k = 102; method: REML)
Variance Components:
outer factor: ID (nlvls = 7)
inner factor: Time (nlvls = 53)
estim sqrt fixed
tau^2 0.9243 0.9614 no
rho 0.9490 no
Test for Residual Heterogeneity:
QE(df = 100) = 233.0267, p-val < .0001
Test of Moderators (coefficient(s) 2):
QM(df = 1) = 0.6065, p-val = 0.4361
Model Results:
estimate se zval pval ci.lb ci.ub
intrcpt -1.1185 0.4172 -2.6808 0.0073 -1.9363 -0.3007 **
NEy 0.4228 0.5429 0.7788 0.4361 -0.6412 1.4868
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
This also works well, however, per your suggestion, I should use CAR in
case time intervals are uneven:
> rma.mv(yi,vi, mods=~NE, random=~Time|ID, struct="CAR", data=dat1)
Error in rma.mv(yi, vi, mods = ~NE, random = ~Time | ID, struct = "CAR", :
Unknown 'struct' specified.
So this is where I got stuck. Any advice?
Thank you very much in advance.
Best wishes,
Arne
More information about the R-sig-meta-analysis
mailing list