Assigns agent or class variables numeric identifiers

recode.agent(data.ab, level = "agent")

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).

level

Can take either "agent" or "class"

Value

A list containing a data frame with recoded agent/class identifiers and a character vector of original agent/class names

Details

Also relabels the agent for any arms in which dose = 0 to "Placebo_0"