Learn R Programming

ctrdata (version 1.22.0)

f.primaryEndpointResults: Calculate type of control data collected in a study

Description

Trial concept calculated: Calculates several results-related elements of the primary analysis of the primary endpoint. Requires loading results-related information. For CTIS and ISRCTN, such information is not available in structured format. Recommended to be combined with .controlType, .sampleSize etc. for analyses.

Usage

f.primaryEndpointResults(df = NULL)

Value

data frame with columns `_id` and new columns: `.primaryEndpointFirstPvalue` (discarding any inequality indicator, e.g. <=), `.primaryEndpointFirstPmethod` (normalised string, e.g. chisquared), `.primaryEndpointFirstPsize` (number included in test, across assignment groups).

Arguments

df

data frame such as from dbGetFieldsIntoDf. If `NULL`, prints fields needed in `df` for calculating this trial concept, which can be used with dbGetFieldsIntoDf.

Examples

Run this code
# fields needed
f.primaryEndpointResults()

# apply trial concept when creating data frame
dbc <- nodbi::src_sqlite(
  dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
  collection = "my_trials", flags = RSQLite::SQLITE_RO)
trialsDf <- dbGetFieldsIntoDf(
  calculate = "f.primaryEndpointResults",
  con = dbc)
trialsDf

Run the code above in your browser using DataLab