Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • x-axis scale for metan

    Hi all,
    I am trying to create a forest plot using metan with a standardized scale of -24, 0, 1, 2, 5, 10, 41, 65. I want to set equidistant space between these ticks. Stata uses the given points on the x-axis with a linear scale, but for example, I want to have equal space between (-24-0) and (0-1) and etc.
    I appreciate any suggestion to deal with this issue.

    Here is the code
    Code:
    metan RR LRR URR, label(namevar=study) random effect(RR) xlab(-24, 0, 1, 2, 5, 10, 41, 65)

  • #2
    Are you peroeming a meta-analysis or trying to use the forest plotting function of metan? If this is actually for a meta-analysis, the choice of scale is bizarre to me and does not have an immediately obvious advantage. I would suggest not changing the scale here.

    If instead you want to mimic the function of the forest plot, you can achieve this with a combination of -twoway rapike- and overlaid with -twoway scatter-. The first lets you plot the whiskers/intervals and the second lets you plot the point estimate. The one thing you will need to do is to manipulate you dataset to have discrete levels for each of your xaxis points (e.g., 1, 2, 3,...) and the label those points with the desired labels using the appropriate xscale() option in your graphing command.

    I'm on mobile right now so I cannot offer a working example, but this should give you something to get started.
    Last edited by Leonardo Guizzetti; 05 Aug 2019, 10:04.

    Comment


    • #3
      Dear Leonardo,
      Yes, I am performing a meta-analysis. The problem is that the difference between the confidence intervals for the various studies is very large and in the final shape of the forest plot, small CI in the majority of studies is not well presented.
      as follows:
      Click image for larger version

Name:	image_15343.png
Views:	1
Size:	84.6 KB
ID:	1511030





      here is my data:
      Code:
       dataex treatment logrr selogrr
      
      ----------------------- copy starting from the next line -----------------------
      
      
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str26 treatment float(logrr selogrr)
      "1"  2.15 1.03
      "2"  -.35  .12
      "3"  -.43  .17
      "3"  -.05  .22
      "3" -1.36  .37
      "3"  -.71  .34
      "3"  -.38  .19
      "4"  1.18  .33
      "5"   .24  .23
      end
      ------------------ copy up to and including the previous line ------------------ Listed 9 out of 9 observations . gen RR=exp(logrr) . . gen LRR=exp(logrr-1.96*selogrr) . . gen URR=exp(logrr+1.96*selogrr) metan RR LRR URR, by(treatment) random effect(RR) xlab(.1, 1, 5, 64) xline(1) xsize(10) ysize(8) Study | ES [95% Conf. Interval] % Weight ---------------------+--------------------------------------------------- 1 1 | 8.585 1.140 64.638 0.00 Sub-total | D+L pooled ES | 8.585 -23.164 40.334 0.00 ---------------------+--------------------------------------------------- 2 2 | 0.705 0.557 0.892 18.14 Sub-total | D+L pooled ES | 0.705 0.537 0.872 18.14 ---------------------+--------------------------------------------------- 3 3 | 0.651 0.466 0.908 16.68 4 | 0.951 0.618 1.464 11.09 5 | 0.257 0.124 0.530 17.18 6 | 0.492 0.252 0.957 12.90 7 | 0.684 0.471 0.992 15.52 Sub-total | D+L pooled ES | 0.579 0.355 0.804 73.37 ---------------------+--------------------------------------------------- 4 8 | 3.254 1.704 6.214 0.81 Sub-total | D+L pooled ES | 3.254 1.000 5.509 0.81 ---------------------+--------------------------------------------------- 5 9 | 1.271 0.810 1.995 7.68 Sub-total | D+L pooled ES | 1.271 0.679 1.864 7.68 ---------------------+--------------------------------------------------- Overall | D+L pooled ES | 0.680 0.472 0.887 100.00 ---------------------+--------------------------------------------------- Heterogeneity calculated by formula Q = SIGMA_i{ (1/variance_i)*(effect_i - effect_pooled)^2 } where variance_i = ((upper limit - lower limit)/(2*z))^2 Test(s) of heterogeneity: Heterogeneity degrees of statistic freedom P I-squared** Tau-squared 1 0.00 0 . .% 0.0000 2 0.00 0 . .% 0.0000 3 13.31 4 0.010 69.9% 0.0440 4 0.00 0 . .% 0.0000 5 0.00 0 . .% 0.0000 Overall 26.56 8 0.001 69.9% 0.0545 ** I-squared: the variation in ES attributable to heterogeneity) Note: between group heterogeneity not calculated; only valid with inverse variance method Significance test(s) of ES=0 1 z= 0.53 p = 0.596 2 z= 8.26 p = 0.000 3 z= 5.06 p = 0.000 4 z= 2.83 p = 0.005 5 z= 4.20 p = 0.000 Overall z= 6.42 p = 0.000 -------------------------------------------------------------------------
      Last edited by Jalal Choupani; 06 Aug 2019, 04:18.

      Comment

      Working...
      X