extract_AE_names: Extracting and setting AE and Drug names from a pvlrt object

View source: R/pvlrt-postprocessing-utils.R

extract_AE_namesR Documentation

Extracting and setting AE and Drug names from a pvlrt object

Description

Extracting and setting AE and Drug names from a pvlrt object

Usage

extract_AE_names(object)

extract_Drug_names(object)

set_AE_names(object, old, new)

set_Drug_names(object, old, new)

Arguments

object

a pvlrt object, which is the output of the function pvlrt or one of its wrappers such as lrt_zi_poisson, lrt_poisson and lrt_vanilla_poisson.

old

character vector containing the old names

new

character vector containing the new names

Value

  • extract_AE_names returns a character vector of the names of the AEs in the input pvlrt object

  • extract_Drug_names returns a character vector of the names of the Drugs in the input pvlrt object

  • set_AE_names returns a new pvlrt object with updated AE names as specified through the arguments old and new.

  • set_Drug_names returns a new pvlrt object with updated Drug names as specified through the arguments old and new.

Note

Because a pvlrt object is simply a reclassified matrix, the AE (rows) and Drug (columns) names can also be extracted/modified through rownames and colnames respectively.

See Also

pvlrt

Examples

# 500 bootstrap iterations (nsim) in the example below
# are for quick demonstration only --
# we recommended setting nsim to 10000 (default) or bigger

test1 <- pvlrt(statin46, test_zi = TRUE, nsim = 500)
extract_AE_names(test1)
extract_Drug_names(test1)

set_AE_names(test1, old = "Rhabdomyolysis", new = "Rhabdo")
set_Drug_names(test1, old = "Other", new = "Other-Drugs")

## can be chained with pipes `%>%`:
test2 <- test1 %>%
  set_AE_names(old = "Rhabdomyolysis", new = "Rhabdo") %>%
  set_Drug_names(old = "Other", new = "Other-Drugs")

# see the summary for changed labels
summary(test2)



pvLRT documentation built on March 7, 2023, 7:17 p.m.