Results schema of the CohortMethod package
Martijn J. Schuemie
2026-02-23
Source:vignettes/ResultsSchema.Rmd
ResultsSchema.RmdIntroduction
This document describes the data model of the output of the
CohortMethod package, generated by the exportToCsv()
function. This vignette assumes you are already familiar with the
CohortMethod package, and have read all other
vignettes.
Fields with minimum values
Some fields contain patient counts or fractions that can easily be converted to patient counts. To prevent identifiability, these fields are subject to a minimum value. When the value falls below this minimum, it is replaced with the negative value of the minimum. For example, if the minimum subject count is 5, and the actual count is 2, the value stored in the data model will be -5, which could be represented as ‘<5’ to the user. Note that the value 0 is permissible, as it identifies no persons. These fields are identified below as having Min. count = ‘Yes’.
Tables
In this section you will find the list of tables and their fields.
Table cm_analysis
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| analysis_id | int | Yes | No | No | A unique identifier for an analysis. |
| description | varchar | No | No | No | A description for an analysis, e.g. ‘On-treatment’. |
| definition | varchar | No | No | No | A CohortMethod JSON object specifying the analysis. |
Table cm_attrition
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| sequence_number | int | Yes | No | No | The place in the sequence of steps defining the final analysis cohort. 1 indicates the original exposed population without any inclusion criteria. |
| description | varchar | No | No | No | A description of the last restriction, e.g. “Removing persons with the outcome prior”. |
| subjects | int | No | Yes | No | The number of subjects in the cohort. |
| exposure_id | bigint | Yes | No | No | The identifier of the exposure cohort to which the attrition applies. Can be either the target or comparator cohort ID. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| analysis_id | int | Yes | No | No | The identifier for the outcome cohort. |
| outcome_id | bigint | Yes | No | No | Foreign key referencing the cm_analysis table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_covariate
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| covariate_id | bigint | Yes | No | No | A unique identified for a covariate. |
| covariate_name | varchar | No | No | No | A name for a covariate, e.g. ‘Age group: 20-25 years’. |
| analysis_id | int | Yes | No | No | Foreign key referencing the cm_analysis table. |
| covariate_analysis_id | int | No | No | No | Foreign key referencing the cm_covariate_analysis table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_covariate_analysis
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| covariate_analysis_id | int | Yes | No | No | A unique identifier for a covariate analysis (only guaranteed to be unique for a given analysis_id and database_id). |
| covariate_analysis_name | varchar | No | No | No | A name for a covariate analysis, e.g. ‘Demographics: age group’. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
Table cm_covariate_balance
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| covariate_id | bigint | Yes | No | No | A foreign key referencing the cm_covariate table. |
| target_mean_before | float | No | Yes | No | The mean value of the covariate in the target cohort before propensity score adjustment. |
| comparator_mean_before | float | No | Yes | No | The mean value of the covariate in the comparator cohort before propensity score adjustment. |
| mean_before | float | No | Yes | No | The mean value of the covariate in the union of the target and comparator cohort before propensity score adjustment. |
| std_diff_before | float | No | No | No | The standardized difference of the means between the target and comparator cohort before propensity score adjustment. |
| std_diff_var_before | float | No | No | No | The variance of the standardized difference of the means between the target and comparator cohort before propensity score adjustment. |
| balanced_before | int | No | No | No | Is the covariate balanced before propensity score adjustment? (1 = yes, 0 = no) |
| mean_after | float | No | Yes | No | The mean value of the covariate in the union of the target and comparator cohort after propensity score adjustment. |
| target_mean_after | float | No | Yes | No | The mean value of the covariate in the target cohort after propensity score adjustment. |
| comparator_mean_after | float | No | Yes | No | The mean value of the covariate in the comparator cohort after propensity score adjustment. |
| std_diff_after | float | No | No | No | The standardized difference of the means between the target and comparator cohort after propensity score adjustment. |
| std_diff_var_after | float | No | No | No | The variance of the standardized difference of the means between the target and comparator cohort after propensity score adjustment. |
| balanced_after | int | No | No | No | Is the covariate balanced after propensity score adjustment? (1 = yes, 0 = no) |
| target_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the target cohort. |
| comparator_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the comparator cohort. |
| target_comparator_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the union of the target and comparator cohorts. |
Table cm_diagnostics_summary
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
| max_sdm | float | No | No | No | The maximum absolute standardized difference of mean. |
| sdm_family_wise_min_p | float | No | No | No | The minimum family-wise P-value for the test whether the absolute SDM exceeds the diagnostic threshold. |
| shared_max_sdm | float | No | No | No | The maximum absolute standardized difference of mean of the shared balance (shared across outcomes). |
| shared_sdm_family_wise_min_p | float | No | No | No | The minimum family-wise P-value for the test whether the absolute SDM exceeds the diagnostic threshold for the shared balance (across all outcomes). |
| equipoise | float | No | No | No | The fraction of the study population with a preference score between 0.3 and 0.7. |
| mdrr | float | No | No | No | The minimum detectable relative risk. |
| attrition_fraction | float | No | No | Yes | DEPRECATED: The fraction of the target population lost by between initial cohort and outcome model due to various restrictions. |
| generalizability_max_sdm | float | No | No | No | The maximum absolute standardized difference of mean comparing before to after adjustment. |
| ease | float | No | No | No | The expected absolute systematic error. |
| balance_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the balance diagnostic (max_sdm). |
| shared_balance_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the shared balance diagnostic (shared_max_sdm). |
| equipoise_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the equipoise diagnostic. |
| mdrr_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the MDRR diagnostic. |
| attrition_diagnostic | varchar(20) | No | No | Yes | DEPRECATED: Pass / warning / fail classification of the attrition fraction diagnostic. |
| generalizability_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the generalizability diagnostic. |
| ease_diagnostic | varchar(20) | No | No | No | Pass / warning / fail classification of the EASE diagnostic. |
| unblind | int | No | No | No | Is unblinding the result recommended? (1 = yes, 0 = no) |
| unblind_for_evidence_synthesis | int | No | No | No | Is unblinding the result for inclusion in evidence synthesis recommended? This ignores the MDRR diagnostic. (1 = yes, 0 = no) |
Table cm_follow_up_dist
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| analysis_id | int | Yes | No | No | Foreign key referencing the cm_analysis table. |
| target_min_days | float | No | No | No | The minimum number of observation days for a person. |
| target_p_10_days | float | No | No | No | The 10th percentile of number of observation days for a person in the target group. |
| target_p_25_days | float | No | No | No | The 25th percentile of number of observation days for a person in the target group. |
| target_median_days | float | No | No | No | The median number of observation days for a person in the target group. |
| target_p_75_days | float | No | No | No | The 75th percentile of number of observation days for a person in the target group. |
| target_p_90_days | float | No | No | No | The 90th percentile of number of observation days for a person in the target group. |
| target_max_days | float | No | No | No | The maximum number of observation days for a person in the target group. |
| comparator_min_days | float | No | No | No | The minimum number of observation days for a person in the comparator group. |
| comparator_p_10_days | float | No | No | No | The 10th percentile of number of observation days for a person in the comparator group. |
| comparator_p_25_days | float | No | No | No | The 25th percentile of number of observation days for a person in the comparator group. |
| comparator_median_days | float | No | No | No | The median number of observation days for a person in the comparator group. |
| comparator_p_75_days | float | No | No | No | The 75th percentile of number of observation days for a person in the comparator group. |
| comparator_p_90_days | float | No | No | No | The 90th percentile of number of observation days for a person in the comparator group. |
| comparator_max_days | float | No | No | No | The maximum number of observation days for a person in the comparator group. |
| target_min_date | Date | No | No | No | The first start date of the target cohort observed in the data (after applying all restrictions). |
| target_max_date | Date | No | No | No | The last start date of the target cohort observed in the data (after applying all restrictions). |
| comparator_min_date | Date | No | No | No | The first start date of the comparator cohort observed in the data (after applying all restrictions). |
| comparator_max_date | Date | No | No | No | The last start date of the comparator cohort observed in the data (after applying all restrictions). |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_interaction_result
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| analysis_id | int | Yes | No | No | Foreign key referencing the cm_analysis table. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| interaction_covariate_id | bigint | Yes | No | No | Foreign key referencing the cm_covariate table. |
| rr | float | No | No | No | The estimated relative risk (e.g. the ratio of hazard ratios). |
| ci_95_lb | float | No | No | No | The lower bound of the 95% confidence interval of the relative risk. |
| ci_95_ub | float | No | No | No | The upper bound of the 95% confidence interval of the relative risk. |
| p | float | No | No | No | The two-sided p-value considering the null hypothesis of no interaction effect. |
| target_subjects | int | No | Yes | No | The number of subject in the target cohort. |
| comparator_subjects | int | No | Yes | No | The number of subject in the comparator cohort. |
| target_days | int | No | No | No | The number of days observed in the target cohort. |
| comparator_days | int | No | No | No | The number of days observed in the comparator cohort. |
| target_outcomes | int | No | Yes | No | The number of outcomes observed in the target cohort. |
| comparator_outcomes | int | No | Yes | No | The number of outcomes observed in the comparator cohort. |
| log_rr | float | No | No | No | The log of the relative risk. |
| se_log_rr | float | No | No | No | The standard error of the log of the relative risk. |
| calibrated_rr | float | No | No | No | The calibrated relative risk. |
| calibrated_ci_95_lb | float | No | No | No | The lower bound of the calibrated 95% confidence interval of the relative risk. |
| calibrated_ci_95_ub | float | No | No | No | The upper bound of the calibrated 95% confidence interval of the relative risk. |
| calibrated_p | float | No | No | No | The calibrated two-sided p-value. |
| calibrated_log_rr | float | No | No | No | The log of the calibrated relative risk. |
| calibrated_se_log_rr | float | No | No | No | The standard error of the log of the calibrated relative risk. |
| target_estimator | varchar | No | No | No | The target estimator, for example “att”, “ate”, “atu” or “ato”. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_kaplan_meier_dist
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| time_day | int | Yes | No | No | Time in days since cohort start. |
| target_survival | float | No | No | No | The estimated survival fraction in the target cohort. |
| target_survival_lb | float | No | No | No | The lower bound of the 95% confidence interval of the survival fraction in the target cohort. |
| target_survival_ub | float | No | No | No | The upper bound of the 95% confidence interval of the survival fraction in the target cohort. |
| comparator_survival | float | No | No | No | The estimated survival fraction in the comparator cohort. |
| comparator_survival_lb | float | No | No | No | The lower bound of the 95% confidence interval of the survival fraction in the comparator cohort. |
| comparator_survival_ub | float | No | No | No | The upper bound of the 95% confidence interval of the survival fraction in the comparator cohort. |
| target_at_risk | int | No | Yes | No | The number of subjects still at risk in the target cohort. |
| comparator_at_risk | int | No | Yes | No | The number of subjects still at risk in the comparator cohort. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_likelihood_profile
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| log_rr | float | Yes | No | No | The log of the relative risk where the likelihood is sampled. |
| log_likelihood | float | No | No | No | The normalized log likelihood. |
| gradient | float | No | No | No | The gradient of the log likelihood. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_preference_score_dist
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
| preference_score | float | Yes | No | No | A preference score value. |
| target_density | float | No | No | No | The distribution density for the target cohort at the given preference score. |
| comparator_density | float | No | No | No | The distribution density for the comparator cohort at the given preference score. |
Table cm_propensity_model
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
| covariate_id | bigint | Yes | No | No | Foreign key referencing the cm_covariate table. 0 is reserved for the intercept. |
| coefficient | float | No | No | No | The coefficient (beta) for the covariate in the propensity model. |
Table cm_result
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| analysis_id | int | Yes | No | No | Foreign key referencing the cm_analysis table. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| rr | float | No | No | No | The estimated relative risk (e.g. the hazard ratio). |
| ci_95_lb | float | No | No | No | The lower bound of the 95% confidence interval of the relative risk. |
| ci_95_ub | float | No | No | No | The upper bound of the 95% confidence interval of the relative risk. |
| p | float | No | No | No | The two-sided p-value considering the null hypothesis of no effect. |
| one_sided_p | float | No | No | No | The one-sided p-value considering the null hypothesis of RR <= 1. |
| target_subjects | int | No | Yes | No | The number of subject in the target cohort. |
| comparator_subjects | int | No | Yes | No | The number of subject in the comparator cohort. |
| target_days | int | No | No | No | The number of days observed in the target cohort. |
| comparator_days | int | No | No | No | The number of days observed in the comparator cohort. |
| target_outcomes | int | No | Yes | No | The number of outcomes observed in the target cohort. |
| comparator_outcomes | int | No | Yes | No | The number of outcomes observed in the comparator cohort. |
| log_rr | float | No | No | No | The log of the relative risk. |
| se_log_rr | float | No | No | No | The standard error of the log of the relative risk. |
| llr | float | No | No | No | The log of the likelihood ratio (of the MLE vs the null hypothesis of no effect). |
| calibrated_rr | float | No | No | No | The calibrated relative risk. |
| calibrated_ci_95_lb | float | No | No | No | The lower bound of the calibrated 95% confidence interval of the relative risk. |
| calibrated_ci_95_ub | float | No | No | No | The upper bound of the calibrated 95% confidence interval of the relative risk. |
| calibrated_p | float | No | No | No | The calibrated two-sided p-value. |
| calibrated_one_sided_p | float | No | No | No | The calibrated one-sided p-value considering the null hypothesis of RR <= 1. |
| calibrated_log_rr | float | No | No | No | The log of the calibrated relative risk. |
| calibrated_se_log_rr | float | No | No | No | The standard error of the log of the calibrated relative risk. |
| target_estimator | varchar | No | No | No | The target estimator, for example “att”, “ate”, “atu” or “ato”. |
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
Table cm_shared_covariate_balance
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| database_id | varchar | Yes | No | No | Foreign key referencing the database. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |
| analysis_id | int | Yes | No | No | A foreign key referencing the cm_analysis table. |
| covariate_id | bigint | Yes | No | No | A foreign key referencing the cm_covariate table. |
| mean_before | float | No | Yes | No | The mean value of the covariate in the union of the target and comparator cohort before propensity score adjustment. |
| target_mean_before | float | No | Yes | No | The mean value of the covariate in the target cohort before propensity score adjustment. |
| comparator_mean_before | float | No | Yes | No | The mean value of the covariate in the comparator cohort before propensity score adjustment. |
| std_diff_before | float | No | No | No | The standardized difference of the means between the target and comparator cohort before propensity score adjustment. |
| std_diff_var_before | float | No | No | No | The variance of the standardized difference of the means between the target and comparator cohort before propensity score adjustment. |
| balanced_before | int | No | No | No | Is the covariate balanced before propensity score adjustment? (1 = yes, 0 = no) |
| mean_after | float | No | Yes | No | The mean value of the covariate in the union of the target and comparator cohort after propensity score adjustment. |
| target_mean_after | float | No | Yes | No | The mean value of the covariate in the target cohort after propensity score adjustment. |
| comparator_mean_after | float | No | Yes | No | The mean value of the covariate in the comparator cohort after propensity score adjustment. |
| std_diff_after | float | No | No | No | The standardized difference of the means between the target and comparator cohort after propensity score adjustment. |
| std_diff_var_after | float | No | No | No | The variance of the standardized difference of the means between the target and comparator cohort after propensity score adjustment. |
| balanced_after | int | No | No | No | Is the covariate balanced after propensity score adjustment? (1 = yes, 0 = no) |
| target_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the target cohort. |
| comparator_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the comparator cohort. |
| target_comparator_std_diff | float | No | No | No | The standardized difference of the means before and after propensity score adjustment in the union of the target and comparator cohorts. |
Table cm_target_comparator
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| target_comparator_id | bigint | Yes | No | No | Primary key for identifying a target-comparator-(nesting cohort) combination |
| target_id | bigint | No | No | No | The identifier for the target cohort. |
| comparator_id | bigint | No | No | No | The identifier for the comparator cohort. |
| nesting_cohort_id | bigint | No | No | No | The identifier for the nesting cohort. Null if not nested. |
Table cm_target_comparator_outcome
| Field | Type | Key | Min. count | Deprecated | Description |
|---|---|---|---|---|---|
| outcome_id | bigint | Yes | No | No | The identifier for the outcome cohort. |
| outcome_of_interest | int | No | No | No | Is the outcome of interest (1 = yes, 0 = no) |
| true_effect_size | float | No | No | No | The true effect size for the target-comparator-outcome. For negatitive controls this equals 1. |
| target_comparator_id | bigint | Yes | No | No | A foreign key referencing the target_comparator table. |