[R] Forestplot question

Thomas Lumley tlumley at uw.edu
Thu May 3 01:10:13 CEST 2012


It works for me with your data:

> dat<-read.table("/tmp/foo.txt",header=TRUE)
> metaplot(a$coef,a$se_coef)

It has boxes of size zero for the point estimates, but that's because
you give the standard error as zero for the second estimate, which
implies all the other boxes should be infinitely smaller.   Presumably
the std error isn't actually zero.

     -thomas

On Thu, May 3, 2012 at 5:39 AM, Ben Ganzfried
<benganzfried at post.harvard.edu> wrote:
> Hi,
>
> I'm trying to build a Forest Plot using the second and fourth columns in
> the table (test.csv) below. My code is the following:
> curated <- data.frame("test.csv")
> tmp <- curated$coef
> tmp1 <- curated$se_coef
> plt <- metaplot(tmp, tmp1, xlim = c(-.45, .45))
>
> I keep getting the following error at the last line and am not sure why:
> Error in if (is.na(lower[i] + upper[i])) next :
>  argument is of length zero
>
> For the metaplot() function, the help page looks like at a minimum I need
> to input the point estimates from the studies as well as the standard
> errors of the point estimates as parameters (an earlier error occurred
> telling me I needed xlim as well).  I would greatly appreciate any
> clarification anyone can provide.
>
>  IDs coef exp_coef se_coef z Pr(>|z|)  1 -0.203063307 0.816226567
> 0.082936899 -2.448407282 0.014348936  2 0 1 0 NA NA  3 -0.193553687
> 0.824025596 0.114027975 -1.697422824 0.089616751  4 -0.032175939 0.968336199
> 0.239318707 -0.134448074 0.893048269  5 -0.20511693 0.814552066 0.121275633
> -1.691328457 0.090774088  6 -0.201827336 0.817236023 0.154827334 -1.30356398
> 0.192382289  7 -0.439783875 0.644175628 0.105856496 -4.154528917 3.26E-05  8
> -0.262717505 0.768959094 0.144606241 -1.816778471 0.069251041  9
> -0.208431217 0.811856875 0.225960968 -0.922421329 0.356308848
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland



More information about the R-help mailing list