optimal_matching: optimal_matching

Description Usage Arguments Details Value Examples

View source: R/funs_with_without_repla.R

Description

optimal_matching is performing the optimal match between cases and controls in an iterative way and computational efficient way

Usage

1
2
3
4
5
6
7
8
9
optimal_matching(
  total_database,
  n_con,
  cluster_var,
  Id_Patient,
  total_cont_per_case,
  case_control,
  with_replacement = FALSE
)

Arguments

total_database

a data frame that contains the cases and controls

n_con

number of controls to be matched

cluster_var

a variable that contains one case with all available controls to be pooled

Id_Patient

Id of the patient

total_cont_per_case

total number of controls that are available for each case

case_control

a variable containing "case" and "control"

with_replacement

Use replacement or not

Details

Here is where I should put all my details. This is where I should give more examples if necessary

Value

a data frame containing the cases and the corresponding number of controls

Examples

1
2
optimal_matching(being_processed, n_con=2, cluster_var=cluster_case,
Id_Patient=Patient_Id, total_cont_per_case=total_control_per_case, case_control = case_control)

pmamouris/ccoptimalmatch documentation built on Dec. 22, 2021, 8:50 a.m.