metaDF2Matrix.metacontDF: Convert 'metabinDF' Objects to Matrices

Description Usage Arguments Details Value See Also Examples

Description

A function that converts 'metacontDF' objects into a character matrix used for plotting.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'metacontDF'
metaDF2Matrix(df,
             order, newCols = NULL,
             roundCols = NULL,
             stats = list(hetero = makeStatsDesc(labelNames =
                                                 c("Q", "p", "df"))),
             groupStats = NULL, newLabel = NULL, colNames,
             groupLab, hgap = NULL, vgap, drop, ...)

Arguments

df

An object of class 'metacontDF'.

newCols

A list of new columns made from existing columns in the data frame. Can use functions makeCIDesc and makeMSDDesc to combine and round columns.

order

A vector of column names in the order that it should appear in the matrix.

roundCols

A named vector with values of rounding to the nearest decimal place of specified column names.

colNames

A vector of column names for the ordered matrix.

groupLab

A vector of labels for subgroups and overall effect.

hgap

A vector of row numbers to add horizontal spaces.

vgap

A vector of column numbers to add vertical spaces.

...

Not used.

Details

Rounding can be applied using the roundCols argument for all numeric columns except for the mean-standard deviation and confidence interval columns which must be done through the newCols argument using makeMSDDesc and makeCIDesc functions.

Value

An object of class 'metacontM' and 'metaM' with a list of following components:

Matrix

A matrix set out as to be drawn in the forest plot.

PlotDF

A data frame with plotting information for drawing the confidence interval graph.

See Also

meta2DF.metacont, drawMeta.metacontM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
### metacont: single group
library(meta)
data(Fleiss93cont)
meta1 <- metacont(n.e, mean.e, sd.e, n.c, mean.c, sd.c,
                  data = Fleiss93cont, sm = "SMD")

Data <- meta2DF(meta1, title = "Mental Health Treatment",
                rowOrder = "effect", decreasing = TRUE)
matrix <- metaDF2Matrix(Data,
                        order = c("study", "msd.e", "msd.c", "effect",
                                  "ci", "w.fixed", "w.random"),
                        roundCols = c("effect" = 2, "w.fixed" = 1,
                                      "w.random" = 1),
                        hgap = c(2, 11), vgap = 5)
### metacont: grouped studies
meta <- metacont(n.e, mean.e, sd.e, n.c, mean.c, sd.c,
                 data = Fleiss93cont, sm = "SMD",
                 byvar = c(1,2,1,1,2), bylab = "group")
Data <- meta2DF(meta, title = "Mental Health Treatment",
                rowOrder = "effect", decreasing = TRUE)
matrix <- metaDF2Matrix(Data,
                        groupLab = c("Group One", "Group Two", "Overall"),
                        order = c("study", "msd.e", "msd.c", "effect",
                                  "ci", "w.fixed", "w.random"),
                        roundCols = c("effect" = 2, "w.fixed" = 1,
                                      "w.random" = 1),
                        hgap=c(2,10,16), vgap = 5)
str(matrix)

pmur002/metaplot documentation built on May 25, 2019, 10:21 a.m.