Skip to contents

Trial concept calculated: sample size of the trial, preferring results-related if available over protocol-related information. Thus, the interpretation of the calculated number depends on the status of the recruitment (see f.statusRecruitment) and on the availability of results data (see f.resultsDate).

Usage

f.sampleSize(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 .sampleSize, an integer.

Examples

# fields needed
f.sampleSize()
#> $euctr
#>  [1] "trialInformation.countrySubjectCounts.countrySubjectCount.subjects"
#>  [2] "f11_number_of_subjects_for_this_age_range"                         
#>  [3] "f1111_number_of_subjects_for_this_age_range"                       
#>  [4] "f1121_number_of_subjects_for_this_age_range"                       
#>  [5] "f1131_number_of_subjects_for_this_age_range"                       
#>  [6] "f1141_number_of_subjects_for_this_age_range"                       
#>  [7] "f1151_number_of_subjects_for_this_age_range"                       
#>  [8] "f1161_number_of_subjects_for_this_age_range"                       
#>  [9] "f121_number_of_subjects_for_this_age_range"                        
#> [10] "f131_number_of_subjects_for_this_age_range"                        
#> 
#> $ctgov
#> [1] "enrollment"
#> 
#> $ctgov2
#> [1] "protocolSection.designModule.enrollmentInfo.count"
#> 
#> $isrctn
#> [1] "participants.targetEnrolment"     "participants.totalFinalEnrolment"
#> 
#> $ctis
#> [1] "totalNumberEnrolled"                                            
#> [2] "authorizedPartsII.recruitmentSubjectCount"                      
#> [3] "authorizedPartI.rowSubjectCount"                                
#> [4] "authorizedApplication.authorizedPartsII.recruitmentSubjectCount"
#> [5] "authorizedApplication.authorizedPartI.rowSubjectCount"          
#> 

# 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.sampleSize",
  con = dbc)
#> To review trial concepts details, call 'help("ctrdata-trial-concepts")'
#> Querying database (19 fields)...
#> Typing fields...
#> Calculating f.sampleSize...                            

trialsDf
#> # A tibble: 25 × 2
#>    `_id`             .sampleSize
#>    <chr>                   <int>
#>  1 12949496                    9
#>  2 13281214                   60
#>  3 17473621                  100
#>  4 2013-000615-24-BE          60
#>  5 2016-004489-24-DE         186
#>  6 2019-002663-10-ES         145
#>  7 2022-000099-20-DE        8057
#>  8 2022-500244-37-00         150
#>  9 2023-505613-24-00          13
#> 10 2023-508143-51-01          11
#> # ℹ 15 more rows