Skip to contents

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)

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.statisticalAnalyses.statisticalAnalysis.statisticalHypothesisTest.value"       
#> [2] "endPoints.endPoint.statisticalAnalyses.statisticalAnalysis.statisticalHypothesisTest.method.value"
#> [3] "endPoints.endPoint.type.value"                                                                    
#> [4] "endPoints.endPoint"                                                                               
#> 
#> $ctgov
#> [1] "clinical_results.outcome_list.outcome.analysis_list.analysis.method" 
#> [2] "clinical_results.outcome_list.outcome.analysis_list.analysis.p_value"
#> [3] "clinical_results.outcome_list.outcome.type"                          
#> [4] "clinical_results.outcome_list.outcome"                               
#> 
#> $ctgov2
#> [1] "resultsSection.outcomeMeasuresModule.outcomeMeasures.analyses.pValue"           
#> [2] "resultsSection.outcomeMeasuresModule.outcomeMeasures.analyses.statisticalMethod"
#> [3] "resultsSection.outcomeMeasuresModule.outcomeMeasures.type"                      
#> [4] "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)
#> Querying database (12 fields)...
trialsDf
#>                  _id .primaryEndpointFirstPvalue .primaryEndpointFirstPmethod
#> 1  2012-003632-23-CZ                       0.013                        other
#> 2  2012-003632-23-SE                       0.013                        other
#> 3  2014-003556-31-GB                          NA                         <NA>
#> 4  2014-003556-31-SE                          NA                         <NA>
#> 5        NCT00617929                          NA                         <NA>
#> 6        NCT01125800                          NA                         <NA>
#> 7        NCT01483820                          NA                         <NA>
#> 8        NCT01505608                          NA                         <NA>
#> 9        NCT01592045                          NA                         <NA>
#> 10       NCT02620761                          NA                         <NA>
#> 11       NCT03325439                          NA                         <NA>
#>    .primaryEndpointFirstPsize
#> 1                         185
#> 2                         185
#> 3                          61
#> 4                          61
#> 5                          11
#> 6                          60
#> 7                           8
#> 8                          14
#> 9                          54
#> 10                         NA
#> 11                         NA