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
#> 

if (FALSE) { # \dontrun{

# 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)
} # }