mb.make.contrast: Convert arm-based MBNMA data to contrast data

View source: R/prepare.functions.R

mb.make.contrastR Documentation

Convert arm-based MBNMA data to contrast data

Description

Converts an object of class mb.network from arm-based long MBNMA data to a data frame with contrast data (a separate contrast for each treatment comparison at each time point within each study). Data can be either long or wide.

Usage

mb.make.contrast(network, datatype = NULL, format = "wide")

Arguments

network

An object of class mb.network

datatype

A string indicating the data type. Can be binomial or normal

format

A string indicating the data format. Can be wide (two additional columns for each variable - contrast arms) or long.

Value

A data frame with the following columns. In wide format, some columns are given the indices 1 and 2 to indicate each arm in a given treatment comparison.:

  • t The treatment in each arm

  • TE The treatment effect (mean difference, log-odds) for the treatment in arm 1 versus the treatment in arm 2

  • seTE The standard error for the treatment effect (mean difference, log-odds) for the treatment in arm 1 versus the treatment in arm 2

  • y The mean response in each arm

  • se The standard error of the mean in each arm

  • r The number of responders in each arm

  • n The total number of participants in each arm

  • fupcount Follow-up identifier

  • time The time the data are reported

  • studyID Study identifier

Examples

# Create mb.network
network <- mb.network(osteopain)

# Convert to wide contrast data
mb.make.contrast(network, format="wide")

# Convert to long contrast data
mb.make.contrast(network, format="long")

MBNMAtime documentation built on Oct. 14, 2023, 5:08 p.m.