Announcement

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

  • Metaprop 'by'

    Hello all,
    I'm using metaprop in Stata 13.1 for Windows to obtain pooled prevalence estimates. I can successfully get estimates and a forest plot when I use the syntax:

    Code:
    .metaprop numerator denominator, random
    However, when I try to use the 'by' option:
    Code:
    .metaprop numerator denominator, random by(period)
    I get an error message:
    Code:
    invalid syntax error r(198)
    I tried using a numeric variable as the by variable (as the ‘period’ variable is a string), but still received the same error. Any thoughts on resolving this much appreciated!

    Thanks,
    ​Sarah
    Last edited by Sarah Larney; 19 Jul 2015, 18:55. Reason: ETA tags

  • #2
    Sarah,

    Just to confirm that I can recreate the error using the first example dataset in the metaprop help file.

    In other words:
    Code:
    use http://fmwww.bc.edu/repec/bocode/a/arbyn2009jcellmolmedfig1.dta, clear
    metaprop num denom, by(tgroup)

    Looking at the trace, it seems it's an undefined global, $hmean, that's causing the problem. You may be able to kludge it as follows (referring again to the example dataset above):
    Code:
    ameans denom
    global hmean = r(mean_h)
    metaprop num denom, by(tgroup)
    (N.B. If you specify an if or in condition to metaprop, you should also specify them to ameans.)


    Alternatively, specifying the ftt option ("Freeman-Tukey Double Arcsine Transformation") to metaprop seems to avoid the error (that is, without the need for my kludge). However, I don't know enough about meta-analysis of proportions to be able to say whether this is appropriate for you or not. That is:
    Code:
    metaprop num denom, by(tgroup) ftt

    Hope that helps,

    David.

    Comment


    • #3
      Thanks David. I will try this today.

      Sarah

      Comment

      Working...
      X