Skip to content

Commit

Permalink
Merge branch 'thyroid_cancer'
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchard committed Dec 13, 2024
2 parents de816bc + 9f8dfc1 commit e041ff1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 37 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: LegendT2dm
Title: Large-Scale Evidence Generation and Evaluation in a Network of Databases
Version: 3.0.0
Version: 3.0.1
Author: Marc A. Suchard [aut, cre],
Martijn J. Schuemie [aut],
Patrick B. Ryan [aut],
Expand Down
9 changes: 8 additions & 1 deletion R/Export.R
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,9 @@ exportDiagnostics <- function(indicationId,
databaseId,
minCellCount,
maxCores,
balanceOnly = FALSE) {
balanceOnly = FALSE,
excludeSensitivityAnalysis = TRUE) {

ParallelLogger::logInfo("Exporting diagnostics")
ParallelLogger::logInfo("- covariate_balance table")
fileName <- file.path(exportFolder, "covariate_balance.csv")
Expand Down Expand Up @@ -1125,6 +1127,11 @@ exportDiagnostics <- function(indicationId,
reference <- readRDS(file.path(outputFolder, indicationId, "cmOutput", "outcomeModelReference.rds"))
outcomesOfInterest <- getOutcomesOfInterest()
reference <- reference[reference$outcomeId %in% outcomesOfInterest, ]

if (excludeSensitivityAnalysis) {
reference <- reference %>% filter(.data$analysisId < 100)
}

reference <- reference[, c("strataFile",
"studyPopFile",
"targetId",
Expand Down
35 changes: 24 additions & 11 deletions inst/settings/ResultsModelSpecs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ covariate_balance,analysis_id,integer,Foreign key referencing the cohort_method_
covariate_balance,covariate_id,bigint,Foreign key referencing the covariate table,Yes,Yes,No,Yes
covariate_balance,target_mean_before,numeric,Mean value of the covariate in the target cohort before propensity score adjustment,Yes,No,No,Yes
covariate_balance,comparator_mean_before,numeric,Mean value of the covariate in the comparator cohort before propensity score adjustment,Yes,No,No,Yes
covariate_balance,std_diff_before,numeric,Standardized difference of the means between the target and comparator cohort before propensity score adjustment,Yes,No,No,Yes
covariate_balance,std_diff_before,numeric,Standardized difference of the means between the target and comparator cohort before propensity score adjustment,No,No,Yes,Yes
covariate_balance,target_mean_after,numeric,Mean value of the covariate in the target cohort after propensity score adjustment,Yes,No,No,Yes
covariate_balance,comparator_mean_after,numeric,Mean value of the covariate in the comparator cohort after propensity score adjustment,Yes,No,No,Yes
covariate_balance,std_diff_after,numeric,Standardized difference of the means between the target and comparator cohort after propensity score adjustment,Yes,No,No,Yes
covariate_balance,std_diff_after,numeric,Standardized difference of the means between the target and comparator cohort after propensity score adjustment,No,No,Yes,Yes
preference_score_dist,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
preference_score_dist,target_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
preference_score_dist,comparator_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
Expand Down Expand Up @@ -129,7 +129,7 @@ cohort_method_analysis,analysis_id,integer,Unique identifier for an analysis,Yes
cohort_method_analysis,description,text,"Description for an analysis, e.g. 'On-treatment'",Yes,No,No,Yes
cohort_method_analysis,definition,text,CohortMethod JSON object specifying the analysis,Yes,No,No,Yes
exposure_of_interest,exposure_id,bigint,Unique identifier for an exposure,Yes,Yes,No,Yes
exposure_of_interest,exposure_name,text, Name for the exposure,Yes,No,No,Yes
exposure_of_interest,exposure_name,text,Name for the exposure,Yes,No,No,Yes
exposure_of_interest,definition,text,OHDSI JSON cohort definition for constructing the exposure,Yes,No,No,Yes
outcome_of_interest,outcome_id,int,Unique identifier for an outcome of interest,Yes,Yes,No,Yes
outcome_of_interest,outcome_name,text,"Name for the outcome, e.g. 'Stroke'",Yes,No,No,Yes
Expand All @@ -138,15 +138,15 @@ outcome_of_interest,definition,text,OHDSI JSON cohort definition for constructin
negative_control_outcome,outcome_id,bigint,Unique identifier for a negative control outcome,Yes,Yes,No,Yes
negative_control_outcome,concept_id,bigint,Concept ID defining the negative control,Yes,Yes,No,Yes
negative_control_outcome,outcome_name,text,"Name for the outcome, e.g. 'Ingrown nail'",Yes,No,No,Yes
ps_auc_assessment,database_id,varchar(255),"Foreign key referencing the database",Yes,Yes,No,Yes
ps_auc_assessment,target_id,bigint,"Foreign key referencing the exposure_of_interest table",Yes,Yes,No,Yes
ps_auc_assessment,comparator_id,bigint,"Foreign key referencing the exposure_of_interest table",Yes,Yes,No,Yes
ps_auc_assessment,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
ps_auc_assessment,target_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
ps_auc_assessment,comparator_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
ps_auc_assessment,analysis_id,integer,Foreign key referencing the cohort_method_analysis table,Yes,Yes,No,Yes
ps_auc_assessment,auc,numeric,"Area under the receiver-operator curve classifying subjects by their propensity score",Yes,No,No,Yes
ps_auc_assessment,equipoise,numeric,"%-subjects with preference scores between 0.3 and 0.7",Yes,No,No,Yes
results_date_time,database_id,varchar(255),"Foreign key referencing the database",Yes,Yes,No,Yes
results_date_time,date_time,varchar(255),"Date and time when results were compiled",Yes,No,No,Yes
results_date_time,package_version,varchar(255), "LegendT2dm package version",Yes,No,No,Yes
ps_auc_assessment,auc,numeric,Area under the receiver-operator curve classifying subjects by their propensity score,Yes,No,No,Yes
ps_auc_assessment,equipoise,numeric,%-subjects with preference scores between 0.3 and 0.7,Yes,No,No,Yes
results_date_time,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
results_date_time,date_time,varchar(255),Date and time when results were compiled,Yes,No,No,Yes
results_date_time,package_version,varchar(255),LegendT2dm package version,Yes,No,No,Yes
diagnostics,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
diagnostics,target_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
diagnostics,comparator_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
Expand All @@ -159,3 +159,16 @@ diagnostics,min_equipoise,numeric,Proportion of subjects in clinical equipoise,N
diagnostics,ease,numeric,Expected absolute systematic error,No,No,No,Yes
diagnostics,pass,integer,Indicator of whether the study has passed the diagnostics,No,No,No,Yes
diagnostics,criteria,varchar(255),Description of diagnostics criteria,No,No,No,Yes
covariate_balance,interaction_covariate_id,bigint,id for covariates of interaction terms,No,No,Yes,Yes
covariate_balance,target_sd_before,numeric,standard deviation in target cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sd_before,numeric,standard deviation in comparator cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,mean_before,numeric,overall mean before PS adjustment,No,No,Yes,Yes
covariate_balance,sd_before,numeric,overall standard deviation before PS adjustment,No,No,Yes,Yes
covariate_balance,target_sd_after,numeric,standard deviation in target cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sd_after,numeric,standard deviation in comparator cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,mean_after,numeric,overall mean after PS adjustment,No,No,Yes,Yes
covariate_balance,sd_after,numeric,overall standard deviation after PS adjustment,No,No,Yes,Yes
covariate_balance,target_sum_before,numeric,sum in target cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sum_before,numeric,sum in comparator cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,target_sum_after,numeric,sum in target cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sum_after,numeric,sum in comparator cohort after PS adjustment,No,No,Yes,Yes
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ cohort_method_analysis,analysis_id,integer,Unique identifier for an analysis,Yes
cohort_method_analysis,description,text,"Description for an analysis, e.g. 'On-treatment'",Yes,No,No,Yes
cohort_method_analysis,definition,text,CohortMethod JSON object specifying the analysis,Yes,No,No,Yes
exposure_of_interest,exposure_id,bigint,Unique identifier for an exposure,Yes,Yes,No,Yes
exposure_of_interest,exposure_name,text,Name for the exposure,Yes,No,No,Yes
exposure_of_interest,exposure_name,text, Name for the exposure,Yes,No,No,Yes
exposure_of_interest,definition,text,OHDSI JSON cohort definition for constructing the exposure,Yes,No,No,Yes
outcome_of_interest,outcome_id,int,Unique identifier for an outcome of interest,Yes,Yes,No,Yes
outcome_of_interest,outcome_name,text,"Name for the outcome, e.g. 'Stroke'",Yes,No,No,Yes
Expand All @@ -138,15 +138,15 @@ outcome_of_interest,definition,text,OHDSI JSON cohort definition for constructin
negative_control_outcome,outcome_id,bigint,Unique identifier for a negative control outcome,Yes,Yes,No,Yes
negative_control_outcome,concept_id,bigint,Concept ID defining the negative control,Yes,Yes,No,Yes
negative_control_outcome,outcome_name,text,"Name for the outcome, e.g. 'Ingrown nail'",Yes,No,No,Yes
ps_auc_assessment,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
ps_auc_assessment,target_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
ps_auc_assessment,comparator_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
ps_auc_assessment,database_id,varchar(255),"Foreign key referencing the database",Yes,Yes,No,Yes
ps_auc_assessment,target_id,bigint,"Foreign key referencing the exposure_of_interest table",Yes,Yes,No,Yes
ps_auc_assessment,comparator_id,bigint,"Foreign key referencing the exposure_of_interest table",Yes,Yes,No,Yes
ps_auc_assessment,analysis_id,integer,Foreign key referencing the cohort_method_analysis table,Yes,Yes,No,Yes
ps_auc_assessment,auc,numeric,Area under the receiver-operator curve classifying subjects by their propensity score,Yes,No,No,Yes
ps_auc_assessment,equipoise,numeric,%-subjects with preference scores between 0.3 and 0.7,Yes,No,No,Yes
results_date_time,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
results_date_time,date_time,varchar(255),Date and time when results were compiled,Yes,No,No,Yes
results_date_time,package_version,varchar(255),LegendT2dm package version,Yes,No,No,Yes
ps_auc_assessment,auc,numeric,"Area under the receiver-operator curve classifying subjects by their propensity score",Yes,No,No,Yes
ps_auc_assessment,equipoise,numeric,"%-subjects with preference scores between 0.3 and 0.7",Yes,No,No,Yes
results_date_time,database_id,varchar(255),"Foreign key referencing the database",Yes,Yes,No,Yes
results_date_time,date_time,varchar(255),"Date and time when results were compiled",Yes,No,No,Yes
results_date_time,package_version,varchar(255), "LegendT2dm package version",Yes,No,No,Yes
diagnostics,database_id,varchar(255),Foreign key referencing the database,Yes,Yes,No,Yes
diagnostics,target_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
diagnostics,comparator_id,bigint,Foreign key referencing the exposure_of_interest table,Yes,Yes,No,Yes
Expand All @@ -159,16 +159,3 @@ diagnostics,min_equipoise,numeric,Proportion of subjects in clinical equipoise,N
diagnostics,ease,numeric,Expected absolute systematic error,No,No,No,Yes
diagnostics,pass,integer,Indicator of whether the study has passed the diagnostics,No,No,No,Yes
diagnostics,criteria,varchar(255),Description of diagnostics criteria,No,No,No,Yes
covariate_balance,interaction_covariate_id,bigint,id for covariates of interaction terms,No,No,Yes,Yes
covariate_balance,target_sd_before,numeric,standard deviation in target cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sd_before,numeric,standard deviation in comparator cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,mean_before,numeric,overall mean before PS adjustment,No,No,Yes,Yes
covariate_balance,sd_before,numeric,overall standard deviation before PS adjustment,No,No,Yes,Yes
covariate_balance,target_sd_after,numeric,standard deviation in target cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sd_after,numeric,standard deviation in comparator cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,mean_after,numeric,overall mean after PS adjustment,No,No,Yes,Yes
covariate_balance,sd_after,numeric,overall standard deviation after PS adjustment,No,No,Yes,Yes
covariate_balance,target_sum_before,numeric,sum in target cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sum_before,numeric,sum in comparator cohort before PS adjustment,No,No,Yes,Yes
covariate_balance,target_sum_after,numeric,sum in target cohort after PS adjustment,No,No,Yes,Yes
covariate_balance,comparator_sum_after,numeric,sum in comparator cohort after PS adjustment,No,No,Yes,Yes
17 changes: 15 additions & 2 deletions inst/sql/postgresql/CreateResultsTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,23 @@ CREATE TABLE covariate_balance (
covariate_id BIGINT NOT NULL,
target_mean_before NUMERIC NOT NULL,
comparator_mean_before NUMERIC NOT NULL,
std_diff_before NUMERIC NOT NULL,
std_diff_before NUMERIC ,
target_mean_after NUMERIC NOT NULL,
comparator_mean_after NUMERIC NOT NULL,
std_diff_after NUMERIC NOT NULL,
std_diff_after NUMERIC ,
interaction_covariate_id BIGINT ,
target_sd_before NUMERIC ,
comparator_sd_before NUMERIC ,
mean_before NUMERIC ,
sd_before NUMERIC ,
target_sd_after NUMERIC ,
comparator_sd_after NUMERIC ,
mean_after NUMERIC ,
sd_after NUMERIC ,
target_sum_before NUMERIC ,
comparator_sum_before NUMERIC ,
target_sum_after NUMERIC ,
comparator_sum_after NUMERIC ,
PRIMARY KEY(database_id, target_id, comparator_id, outcome_id, analysis_id, covariate_id)
);

Expand Down

0 comments on commit e041ff1

Please sign in to comment.