eudract (version 1.0.0)

safety_summary: Calculate frequency tables from a rectangular data frame with one row per subject-event

Description

Calculate frequency tables from a rectangular data frame with one row per subject-event

Usage

safety_summary(
  data,
  exposed,
  excess_deaths = 0,
  freq_threshold = 0,
  soc_index = c("meddra", "soc_term"),
  na.action = na.fail
)

Value

a list of three dataframes: GROUP, SERIOUS, NON_SERIOUS. Each contains the summary statistics required by EudraCT, and is suitable for export.

Arguments

data

a data set containing the following columns: subjid, term, soc, serious, related, fatal, group. See safety for more details.

exposed

a numeric vector giving the numbers of subjects exposed in each group. This needs to be supplied directly by the user, and cannot be inferred from the input data with one row per patient-event. To ensure the ordering is correct either, name the vector with names matching the values in data$group, or ensure that the data$group is an ordered factor, or relying on alphabetical ordering of the values in data$group

excess_deaths

a numeric vector giving the number of extra deaths not reported within data. Defaults to 0.

freq_threshold

a value on a percentage scale at which to remove events if the incidence falls below. Defaults to 0

soc_index

a character vector either "meddra" or "soc_term", which is used to identify if the soc variable in data gives the numerical meddra code or the description in English.

na.action

a function that indicates what should happen if the data contain missing values. The default is na.fail as both repositories will not accept any missing values in the upload. Alternatives could be na.omit, na.exclude, or na.pass.

See Also

eudract_convert simple_safety_xml

Examples

Run this code
safety_statistics <- safety_summary(safety,
                                    exposed=c("Experimental"=60,"Control"=67))
simple <- tempfile(fileext = ".xml")
eudract <- tempfile(fileext = ".xml")
ct <- tempfile(fileext = ".xml")
simple_safety_xml(safety_statistics, simple)
eudract_convert(input=simple,
                output=eudract)
clintrials_gov_convert(input=simple,
                       original=system.file("extdata", "1234.xml", package ="eudract"),
                output=ct)
if (FALSE) {
  # This needs a real user account to work
  clintrials_gov_upload(
    input=simple,
    orgname="CTU",
    username="Student",
    password="Guinness",
    studyid="1234"
    )

}

Run the code above in your browser using DataLab