The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


analyses:viechtbauer2007b

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
analyses:viechtbauer2007b [2020/06/26 06:54] Wolfgang Viechtbaueranalyses:viechtbauer2007b [2022/03/26 15:28] Wolfgang Viechtbauer
Line 11: Line 11:
 dat <- dat[c(7:10,13:25), c(13:16,18:19,11,6,7,9)] dat <- dat[c(7:10,13:25), c(13:16,18:19,11,6,7,9)]
 dat$dosage <- (dat$dosage * 7) / 1000 dat$dosage <- (dat$dosage * 7) / 1000
 +rownames(dat) <- 1:nrow(dat)
 dat dat
 </code> </code>
Line 34: Line 35:
 17 98 186 80 189  0.2189 0.0120   6.30         21.9        6 17 98 186 80 189  0.2189 0.0120   6.30         21.9        6
 </code> </code>
-Variables ''ai'' and ''ci'' indicate the number of participants with significant improvements between baseline and the follow-up assessment in the treatment and the placebo group, respectively, variables ''n1i'' and ''n2i'' are the corresponding group sizes, variable ''yi'' is the log of the relative improvement rate (i.e., the improvement rate in the treatment group divided by the improvement rate in the placebo group), ''vi'' is the corresponding sampling variance, ''dosage'' is the weekly dosage (in grams) of the //Hypericum// extract used in each study, ''major'' indicates whether a study was restricted to participants with major depression or not (1 or 0, respectively), ''baseline'' denotes the average score on the Hamilton Rating Scale for Depression (HRSD) at baseline (i.e., before treatment begin), and ''duration'' indicates the number of treatment weeks before response assessment. Variables ''yi'' and ''vi'' are not actually included in the original dataset and were added by means of the ''escalc()'' function.+Variables ''ai'' and ''ci'' indicate the number of participants with significant improvements between baseline and the follow-up assessment in the treatment and the placebo group, respectively, variables ''n1i'' and ''n2i'' are the corresponding group sizes, variable ''yi'' is the log of the relative improvement rate (i.e., the improvement rate in the treatment group divided by the improvement rate in the placebo group), ''vi'' is the corresponding sampling variance, ''dosage'' is the weekly dosage (in grams) of the //Hypericum// extract used in each study, ''major'' indicates whether a study was restricted to participants with major depression or not (1 or 0, respectively), ''baseline'' denotes the average score on the Hamilton Rating Scale for Depression (HRSD) at baseline (i.e., before the treatment), and ''duration'' indicates the number of treatment weeks between the baseline and the response assessment. Variables ''yi'' and ''vi'' are not actually included in the original dataset and were added by means of the ''escalc()'' function.
  
 Note that, for illustration purposes, only a subset of the data from the Linde et al. (2005) meta-analysis are actually included in this example. Therefore, no substantive interpretations should be attached to the results of the analyses given below. Note that, for illustration purposes, only a subset of the data from the Linde et al. (2005) meta-analysis are actually included in this example. Therefore, no substantive interpretations should be attached to the results of the analyses given below.
Line 45: Line 46:
 </code> </code>
 <code output> <code output>
-   ai n1i ci n2i   yi   vi dosage major baseline duration  sei    zi ci.lb ci.ub +   ai n1i ci n2i   yi dosage major baseline duration ci.lb ci.ub  
-1  20  25 11  25 1.82 0.06   2.66         19.5        8 0.25  2.42  1.12  2.95 +1  20  25 11  25 1.82   2.66         19.5        8  1.12  2.95  
-2  14  20  9  20 1.56 0.08   6.30         12.5        4 0.29  1.54  0.89  2.73+2  14  20  9  20 1.56   6.30         12.5        4  0.89  2.73
 . .
-13 55 123 57 124 0.97 0.02   6.30         21.5        6 0.14 -0.20  0.74  1.28+13 55 123 57 124 0.97   6.30         21.5        6  0.74  1.28
 . .
-17 98 186 80 189 1.24 0.01   6.30         21.9        6 0.11  2.00  1.00  1.54+17 98 186 80 189 1.24   6.30         21.9        6  1.00  1.54
 </code> </code>
 With ''transf=exp'', the values of the outcome measure (i.e., the log relative improvement rates) and corresponding confidence interval bounds are exponentiated and hence transformed back from the log scale. Therefore, variable ''yi'' now indicates the relative improvement rate, and ''ci.lb'' and ''ci.ub'' are the bounds of an approximate 95% confidence interval for the true relative improvement rate in the individual studies (note that this is not a permanent change -- object ''dat'' still contains the log transformed values, which we need for the analyses below). With ''transf=exp'', the values of the outcome measure (i.e., the log relative improvement rates) and corresponding confidence interval bounds are exponentiated and hence transformed back from the log scale. Therefore, variable ''yi'' now indicates the relative improvement rate, and ''ci.lb'' and ''ci.ub'' are the bounds of an approximate 95% confidence interval for the true relative improvement rate in the individual studies (note that this is not a permanent change -- object ''dat'' still contains the log transformed values, which we need for the analyses below).
Line 59: Line 60:
 The first model discussed in the article assumes that the //true// relative improvement rates are identical in the various studies and the only reason why the //observed// relative improvement rates differ from each other is due to sampling error/variability. We can fit this model with: The first model discussed in the article assumes that the //true// relative improvement rates are identical in the various studies and the only reason why the //observed// relative improvement rates differ from each other is due to sampling error/variability. We can fit this model with:
 <code rsplus> <code rsplus>
-res <- rma(yi, vi, data=dat, method="FE", digits=2)+res <- rma(yi, vi, data=dat, method="EE", digits=2)
 res res
 </code> </code>
 <code output> <code output>
-Fixed-Effects Model (k = 17)+Equal-Effects Model (k = 17)
  
-Test for Heterogeneity: +I^2 (total heterogeneity / total variability):   68.96% 
 +H^2 (total variability / sampling variability):  3.22 
 + 
 +Test for Heterogeneity:
 Q(df = 16) = 51.55, p-val < .01 Q(df = 16) = 51.55, p-val < .01
  
 Model Results: Model Results:
  
-estimate       se     zval     pval    ci.lb    ci.ub           +estimate    se  zval  pval  ci.lb  ci.ub 
-    0.33     0.05     6.78     <.01     0.23     0.42      *** +    0.33  0.05  6.78  <.01   0.23   0.42  ***
  
 --- ---
-Signif. codes: ***’ 0.001 **’ 0.01 *’ 0.05 .’ 0.1 ‘ ’ 1+Signif. codes: '***0.001 '**0.01 '*0.05 '.0.1 ' ' 1
 </code> </code>
 Since we are analyzing the log of the relative improvement rates, the model estimate also reflects the log relative rate. For easier interpretation, it is useful to back-transform the results with: Since we are analyzing the log of the relative improvement rates, the model estimate also reflects the log relative rate. For easier interpretation, it is useful to back-transform the results with:
Line 90: Line 94:
 Given that the true (log) relative rates are apparently heterogeneous, we can consider two possibilities: Given that the true (log) relative rates are apparently heterogeneous, we can consider two possibilities:
  
-  - We can interpret the model estimate obtained above as an estimate of the (weighted) average of the true log relative rates for these 17 studies. This is the so-called fixed-effects model, which allows us to make a //conditional// inference (about the average effect) that only pertains to this set of studies.+  - We can interpret the model estimate obtained above as an estimate of the (weighted) average of the true log relative rates for these 17 studies. This is the so-called fixed-effects model, which allows us to make a //conditional// inference (about the average effect) that only pertains to this set of studies. For a more in-depth discussion of the fixed-effects model, see [[https://wviechtb.github.io/metafor/reference/misc-models.html|here]].
   - We can model the heterogeneity in the true log relative rates and apply a random-effects model. This allows us to make an //unconditional// inference about a larger population of studies from which the included set of studies are assumed to be a random selection.   - We can model the heterogeneity in the true log relative rates and apply a random-effects model. This allows us to make an //unconditional// inference about a larger population of studies from which the included set of studies are assumed to be a random selection.
  
Line 107: Line 111:
 H^2 (total variability / sampling variability):  3.22 H^2 (total variability / sampling variability):  3.22
  
-Test for Heterogeneity: +Test for Heterogeneity:
 Q(df = 16) = 51.55, p-val < .01 Q(df = 16) = 51.55, p-val < .01
  
 Model Results: Model Results:
  
-estimate       se     zval     pval    ci.lb    ci.ub           +estimate    se  zval  pval  ci.lb  ci.ub  
-    0.45     0.09     4.87     <.01     0.27     0.63      *** +    0.45  0.09  4.87  <.01   0.27   0.63  *** 
  
 --- ---
Line 134: Line 138:
 dat$dosage <- dat$dosage * dat$duration dat$dosage <- dat$dosage * dat$duration
 </code> </code>
-The baseline HRSD score will be used to reflect the severity of the depression in the patients. Since these two variables may interact, their product will also be included in the model. Finally, for easier interpretation, we will also center the variables at (roughly) their means when including them in the model.+The baseline HRSD score will be used to reflect the severity of the depression in the patients. Since these two variables may interact, their product will also be included in the model. Finally, for easier interpretation, we will center the variables at (roughly) their means when including them in the model.
  
 We can fit a mixed-effects meta-regression model with these moderators to the data with: We can fit a mixed-effects meta-regression model with these moderators to the data with:
Line 151: Line 155:
 R^2 (amount of heterogeneity accounted for):            47.38% R^2 (amount of heterogeneity accounted for):            47.38%
  
-Test for Residual Heterogeneity: +Test for Residual Heterogeneity:
 QE(df = 13) = 27.9903, p-val = 0.0091 QE(df = 13) = 27.9903, p-val = 0.0091
  
-Test of Moderators (coefficient(s) 2,3,4): +Test of Moderators (coefficients 2:4):
 QM(df = 3) = 10.1280, p-val = 0.0175 QM(df = 3) = 10.1280, p-val = 0.0175
  
 Model Results: Model Results:
  
-                                 estimate      se     zval    pval    ci.lb   ci.ub      +                                 estimate      se     zval    pval    ci.lb   ci.ub  
-intrcpt                            0.4763  0.0876   5.4342  <.0001   0.3045  0.6480  *** +intrcpt                            0.4763  0.0876   5.4342  <.0001   0.3045  0.6480  ***  
-I(dosage - 34)                    -0.0058  0.0100  -0.5846  0.5588  -0.0254  0.0138      +I(dosage - 34)                    -0.0058  0.0100  -0.5846  0.5588  -0.0254  0.0138       
-I(baseline - 20)                  -0.0672  0.0352  -1.9086  0.0563  -0.1363  0.0018    . +I(baseline - 20)                  -0.0672  0.0352  -1.9086  0.0563  -0.1363  0.0018    .  
-I(dosage - 34):I(baseline - 20)   -0.0016  0.0034  -0.4555  0.6487  -0.0083  0.0052     +I(dosage - 34):I(baseline - 20)   -0.0016  0.0034  -0.4555  0.6487  -0.0083  0.0052      
  
 --- ---
Line 183: Line 187:
  1.26  0.99  1.61  0.77  2.07  1.26  0.99  1.61  0.77  2.07
 </code> </code>
-So, for a low baseline HRSD score (i.e., mildly depressed patients), the estimated average relative improvement rate is quite high (2.67 with 95% CI: 1.46 to 4.88), but at a high baseline HRSD score (i.e., more severely depressed patients), the estimated average relative improvement rate is low (1.26 with 95% CI: 0.99 to 1.61) and in fact not significantly different from 1.+So, for a low baseline HRSD score (i.e., for mildly depressed patients), the estimated average relative improvement rate is quite high (2.67 with 95% CI: 1.46 to 4.88), but at a high baseline HRSD score (i.e., for more severely depressed patients), the estimated average relative improvement rate is low (1.26 with 95% CI: 0.99 to 1.61) and in fact not significantly different from 1.
  
 As shown in Figure 3 in the article, we can illustrate these results with a scatterplot of the data, superimposing a line (or rather: curve after the back-transformation) with the estimated average relative improvement rate based on the model for different baseline HRSD scores, holding the total dosage value constant at 34. This figure can be re-created with: As shown in Figure 3 in the article, we can illustrate these results with a scatterplot of the data, superimposing a line (or rather: curve after the back-transformation) with the estimated average relative improvement rate based on the model for different baseline HRSD scores, holding the total dosage value constant at 34. This figure can be re-created with:
 <code rsplus> <code rsplus>
-size <- 1 / sqrt(dat$vi) +xvals   <- seq(12, 24, by=0.1- 20 
-size <- 0.15 * size / max(size) +modvals <- cbind(0, cbind(xvals, 0)) 
- +preds   <- predict(res, modvals)
-modvals <- cbind(0, cbind(seq(1224, by=0.1)) - 20, 0+
-preds   <- predict(res, modvals, transf=exp)+
  
-plot(NANAxlab="Baseline HRSD Score"ylab="Relative Rate", xlim=c(12,24), ylim=c(0.5,4.0), bty="l") +regplot(resmod=3pred=predsxvals=xvals, 
-abline(h=seq(14, by=0.5), col="lightgray") +        shade=FALSE, bty="l", las=1, digits=1, transf=exp, 
-abline(v=seq(14, 24, by=2), col="lightgray"+        xlim=c(12,24)-20, ylim=c(0.5,4), xaxt="n", 
-lines(modvals[,2] + 20, preds$pred, col="darkgray", lwd=2) +        xlab="Baseline HRSD Score"ylab="Relative Rate") 
-lines(modvals[,2] + 20preds$ci.lb, col="darkgray", lty="dashed", lwd=2) +axis(side=1, at=seq(12, 24, by=2) 20, labels=seq(1224by=2))
-lines(modvals[,2] + 20, preds$ci.ub, col="darkgray", lty="dashed", lwd=2) +
-symbols(dat$baseline, exp(dat$yi), circles=size, inches=FALSE, add=TRUE, bg="black")+
 </code> </code>
  
analyses/viechtbauer2007b.txt · Last modified: 2022/08/03 11:24 by Wolfgang Viechtbauer