mb.validate.data: Validates that a dataset fulfils requirements for MBNMA

View source: R/prepare.functions.R

mb.validate.dataR Documentation

Validates that a dataset fulfils requirements for MBNMA

Description

Validates that a dataset fulfils requirements for MBNMA

Usage

mb.validate.data(data.ab, single.arm = FALSE, CFB = TRUE)

Arguments

data.ab

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

  • studyID Study identifiers

  • time Numeric data indicating follow-up times

  • y Numeric data indicating the aggregate response for a given observation (e.g. mean)

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

  • treatment Treatment identifiers (can be numeric, factor or character)

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

  • n An optional column indicating the number of participants used to calculate the response at a given observation (required if modelling using Standardised Mean Differences)

  • 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 or not function should allow singe arm studies to be allowed in the network without returning an error. Default is not to allow their inclusion (single.arm=FALSE)

CFB

A boolean object to indicate if the dataset is composed of studies measuring change from baseline (TRUE) or not (FALSE). It is not essential to specify this correctly but failing to do so may lead to warnings.

Details

Checks done within the validation:

  • Checks data.ab has required column names

  • Checks there are no NAs

  • Checks that all SEs are positive

  • Checks that studies have baseline measurement (unless change from baseline data is being used)

  • Checks that arms are balanced at each time point

  • Checks that class codes are consistent within each treatment

  • Checks that treatment codes are consistent across different time points within a study

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

  • Checks that standsd values are consistent within a study

Value

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


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