Skip to contents

Calculate type of assignment to intervention in a study

Usage

f.assignmentType(df = NULL)

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.

Value

data frame with columns `_id` and `.assignmentType`, which is a factor with levels `R` (randomised assignment) and `NR` (all other types of assignment).

Examples

# fields needed
f.assignmentType()
#> $euctr
#> [1] "e811_randomised"                                                               
#> [2] "subjectDisposition.postAssignmentPeriods.postAssignmentPeriod.allocation.value"
#> 
#> $ctgov
#> [1] "study_design_info.allocation"
#> 
#> $ctgov2
#> [1] "protocolSection.designModule.designInfo.allocation"
#> 
#> $isrctn
#> [1] "trialDesign.studyDesign"
#> 
#> $ctis
#> [1] "authorizedPartI.trialDetails.protocolInformation.studyDesign.periodDetails.allocationMethod"                      
#> [2] "authorizedApplication.authorizedPartI.trialDetails.protocolInformation.studyDesign.periodDetails.allocationMethod"
#> 
#> [[6]]
#> [1] "ctrname"
#> 

# 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(
  field = "ctrname",
  calculate = "f.assignmentType",
  con = dbc)
#> To review trial concepts details, call 'help("ctrdata-trial-concepts")'
#> Querying database (8 fields)...
#> Calculating f.assignmentType...                            

trialsDf
#>                  _id ctrname .assignmentType
#> 1           12949496  ISRCTN               R
#> 2           13281214  ISRCTN               R
#> 3           17473621  ISRCTN               R
#> 4  2012-003632-23-CZ   EUCTR              NR
#> 5  2012-003632-23-SE   EUCTR              NR
#> 6  2014-002606-20-PT   EUCTR               R
#> 7  2014-003556-31-GB   EUCTR              NR
#> 8  2014-003556-31-SE   EUCTR              NR
#> 9  2022-500244-37-00    CTIS              NR
#> 10 2022-501142-30-00    CTIS               R
#> 11 2023-505613-24-00    CTIS              NR
#> 12 2023-508143-51-01    CTIS              NR
#> 13 2024-510663-34-00    CTIS              NR
#> 14          20343063  ISRCTN               R
#> 15          61070850  ISRCTN               R
#> 16          76463425  ISRCTN               R
#> 17          80181452  ISRCTN               R
#> 18          88261002  ISRCTN               R
#> 19       NCT00617929  CTGOV2              NR
#> 20       NCT01125800  CTGOV2              NR
#> 21       NCT01483820  CTGOV2              NR
#> 22       NCT01505608  CTGOV2               R
#> 23       NCT01592045  CTGOV2               R
#> 24       NCT02620761   CTGOV               R
#> 25       NCT03280147   CTGOV               R
#> 26       NCT03325439   CTGOV              NR
#> 27       NCT03431558   CTGOV               R
#> 28       NCT03876704   CTGOV               R
#> 29       NCT04001712   CTGOV               R
#> 30       NCT04041765   CTGOV               R
#> 31       NCT05969327   CTGOV               R