Validates that a dataset fulfills requirements for MBNMA

mbnma.validate.data(data.ab, single.arm = FALSE)

Arguments

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required for continuous data.

  • se Numeric data indicating the standard error for a given observation. Required for continuous data.

  • r Numeric data indicating the number of responders within a study arm. Required for binomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required for binomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Required for poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifier must also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardise treatment effects when modelling using Standardised Mean Differences (SMD).

single.arm

A boolean object to indicate whether to allow single arm studies in the dataset (TRUE) or not (FALSE)

Value

An error if checks are not passed. Runs silently if checks are passed

Details

Checks done within the validation:

  • Checks data.ab has required column names

  • Checks there are no NAs

  • Checks that all SEs are >0 (if variables are included in dataset)

  • Checks that all doses are >=0

  • Checks that all r and n are positive (if variables are included in dataset)

  • Checks that all y, se, r, n and E are numeric

  • Checks that class codes are consistent within each agent

  • Checks that agent/class names do not contain restricted characters

  • Checks that studies have at least two arms (if single.arm = FALSE)

  • Checks that each study includes at least two treatments

  • Checks that agent names do not include underscores

  • Checks that standsd values are consistent within a study