Closed badgettrg closed 4 years ago
Hi,
Ad 1.
R function forest.meta()
has a certain set of predefined columns shown in a forest plot (see help page, under Details). The columns author and year do not belong to this set of columns and are accordingly additional columns. By default, additional columns are middle-aligned. You can use argument just.addcols
(or just.addcols.left
and just.addcols.right
) to change the alignment of additional columns.
Ad 2.
Argument digits.addcols
(or digits.addcols.left
and digits.addcols.right
) can be used to change the number of decimal places for additional columns. However, with meta, version 4.9-9, additional columns do not show any decimal place if the column contains integers (like the column year).
Ad 3. In order to show labels and results for subgroups, the column studlab must be present on the left side of the forest plot.
Please have a look at the following examples:
# Use argument 'just.addcols'
forest(meta1, comb.random = FALSE,
leftcols = c('author', 'year'), just.addcols = c('left', 'center'))
# Print (correct) study labels contained in "studlab"
forest(meta1, comb.random = FALSE,
leftcols = c("studlab", "year"), leftlabs = c("Author", "Year"),
print.byvar = FALSE, colgap.left = "2.25cm")
# Change study labels to author name
forest(update(meta1, studlab = author), comb.random = FALSE,
leftcols = c("studlab", "year"), leftlabs = c("Author", "Year"),
print.byvar = FALSE, colgap.left = "2.25cm")
Solved by your comment, "the column studlab must be present on the left side."
Thanks much
Finally fixed, new code for meta, version 5.0 and above:
data(Olkin95)
Olkin95$modern <- ifelse(Olkin95$year>1980 , 'Modern', 'Old')
meta1 <- metabin(event.e, n.e, event.c, n.c, subset=20:27,
data=Olkin95, sm="RR",
studlab=paste(author, year),
subgroup = modern, random = FALSE)
# Default, without leftcols
forest(meta1)
# Specifying leftcols without "studlab" also works now
forest(meta1, leftcols=c('author', 'year'), addrows = 2)
Summary
When left columns are specified with leftcols, three problems occur
Thanks very much for your time and the meta package.