View source: R/get_threshold.R
get_threshold | R Documentation |
To find a threshold for distance to define controls that are qualified to be matched with a case.
get_threshold(data, vars, case_var = "case", p_threshold = 0.5, seed = 1600)
data |
The dataset |
vars |
The variables to use for calculating distance |
case_var |
The name of the case identifier variable |
p_threshold |
The probability that the closest matching approach
produces the closer matching relative to the random matching approach.
The greater |
seed |
A random seed. |
This function uses logistic regression to predict by the distance whether a control is the closest (unique) match for each case vs. a random selection and by default returns the 50
For more information, please refer to the vignette using
browseVignettes("nncc")
.
A list with items:
threshold |
The numeric threshold chosen |
modeldata |
The data used to fit the logistic regression model |
strata |
The strata made by make_knn_strata |
model |
The fit logisitic regression model |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.