Calculate details of a study's primary endpoint statistical testing
Source:R/f_primaryEndpointResults.R
f.primaryEndpointResults.RdTrial concept calculated: Calculates several results-related elements of the primary statistical 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 f.controlType, f.sampleSize, f.assignmentType and other ctrdata-trial-concepts for analyses.
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 new columns: `.primaryEndpointFirstPvalue` (discarding any inequality indicator, e.g. <=), `.primaryEndpointFirstPmethod` (normalised string, e.g. chisquared), `.primaryEndpointFirstPsize` (number included in test, across assignment groups).
Examples
# fields needed
f.primaryEndpointResults()
#> $euctr
#> [1] "endPoints.endPoint.type.value" "endPoints.endPoint"
#>
#> $ctgov
#> [1] "clinical_results.outcome_list.outcome.type"
#> [2] "clinical_results.outcome_list.outcome"
#>
#> $ctgov2
#> [1] "resultsSection.outcomeMeasuresModule.outcomeMeasures.type"
#> [2] "resultsSection.outcomeMeasuresModule.outcomeMeasures"
#>
#> $isrctn
#> NULL
#>
#> $ctis
#> NULL
#>
# 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)
#> To review trial concepts details, call 'help("ctrdata-trial-concepts")'
#> Querying database (6 fields)...
#> , typing fields...
#> Calculating f.primaryEndpointResults...
trialsDf
#> # A tibble: 11 × 4
#> `_id` .primaryEndpointFirstPvalue .primaryEndpointFirstPmethod
#> <chr> <dbl> <chr>
#> 1 2016-004489-24-DE 0.001 cochranmantelhaenszel
#> 2 2019-002663-10-ES 0.0001 ancova
#> 3 2022-000099-20-DE 0.0001 exactusingbinomialdistribution
#> 4 NCT00567567 0.0082 logrank
#> 5 NCT00716976 NA NA
#> 6 NCT01305200 NA NA
#> 7 NCT01987596 NA NA
#> 8 NCT03275402 NA NA
#> 9 NCT03325556 NA NA
#> 10 NCT03443973 NA NA
#> 11 NCT03548584 NA NA
#> # ℹ 1 more variable: .primaryEndpointFirstPsize <dbl>