forestplot function
forestplot.Rdforestplot function
Usage
forestplot(
df,
name = name,
estimate = estimate,
se = se,
pvalue = NULL,
label_column = NULL,
label_width = 1,
colour = NULL,
shape = NULL,
logodds = FALSE,
psignif = 0.05,
ci = 0.95,
...
)Arguments
- df
A data frame with the data to plot. It must contain at least three variables, a character column with the names to be displayed on the y-axis (see parameter
name), a numeric column with the value (or the log of the value) to display (see parameterestimate) and a numeric value with the corresponding standard errors (see parameterse). It may contain additional columns, e.g. the corresponding p-values (see parameterpvalue) in which case, in conjuction with the threshold given inpsignif, the non-significant results will be displayed as hollow points. Other variables may be used as ggplot2::aesthetics to define the colour and the shape of the points to be plotted.- name
the variable in
dfthat contains the y-axis names. This argument is automatically quoted and evaluated in the context of thedfdata frame.- estimate
the variable in
dfthat contains the values (or log of values) to be displayed. This argument is automatically quoted and evaluated in the context of thedfdata frame.- se
the variable in the
dfdata frame that contains the standard error values. This argument is automatically quoted and evaluated in the context of thedfdata frame.- pvalue
the variable in
dfthat contains the p-values. Defaults to NULL. When explicitly defined, in conjuction with the p-value threshold provided in thepsignif, the non-significant entries will be drawn as hollow points. This argument is automatically quoted and evaluated in the context of thedfdata frame.- label_column
Optional variable in
dfthat contains the labels to display. If provided, a separate label plot will be generated and combined with the forest plot.- label_width
A numeric value to specify the relative width of the label plot in the combined output. Default is 1.
- colour
the variable in
dfby which to colour the different groups of points.- shape
the variable in
dfby which to shape the different groups of points.- logodds
logical (defaults to FALSE) specifying whether the
estimateparameter should be treated as log odds/hazards ratio (TRUE) or not (FALSE). Whenlogodds= TRUE the estimates and corresponding confidence intervals will be exponentiated and a log scale will be used for the x-axis.- psignif
numeric, defaults to 0.05. The p-value threshold for statistical significance. Entries with larger than
psignifwill be drawn with a hollow point.- ci
A number between 0 and 1 (defaults to 0.95) indicating the type of confidence interval to be drawn.
- ...
ggplot2graphical parameters such astitle,ylab,xlab,xtickbreaksetc. to be passed along.