Description Usage Arguments Value See Also Examples
Find significant pairs using the Bonferroni method and (optionally) with the shuffling algorithm to avoid False-Positives. This is the wrap-up of the following functions:
prepare_db
get_observed_pairs
Bonferroni_m
adjust_visits
(only if the shuffling algorithm is performed)
Shuffling_simulation
(optional)
1 2 3 4 5 6 7 8 9 10 11 | find_pairs(your_database,
ids_column,
dates_column,
prob = 1/75,
alpha = 0.01,
only_significant = TRUE,
shuffling = FALSE,
n_shuffl = 100,
period_months = 3,
FP_threshold = max,
max_threshold = NULL)
|
your_database |
a data frame with the clinic visit dates in a long format. |
ids_column |
character, column name with the person identifiers |
dates_column |
character, column name with the visit dates |
prob |
probability of sharing a single visit, default |
alpha |
type I error |
only_significant |
returns only the significant pairs above the threshold (default) or all the pairs with the corresponding p-values |
shuffling |
logical indicating if the shuffling should be performed. By default ( |
n_shuffl |
number of repetitions of shuffling algorithm (default 100) |
period_months |
the length of the follow-up period in months (by default |
FP_threshold |
the function used to get the False-Positive fraction from the shuffling repetitions at each position. By default the |
max_threshold |
maximum false-positive threshold to be inspected. If it is |
A list containing
"unadjusted_pairs"
pairs with unadjusted number of shared visits
"Bonferroni_pairs"
pairs obtained with the Bonferroni correction. If significant_only==TRUE
only those above the threshold are returned.
"adjusted_pairs"
pairs with adjusted number of shared visits returned only if shuffling==TRUE
.
"Shuffled_pairs"
pairs obtained by the shuffling algorithm (returned only if shuffling==TRUE
).
"shuffling_threshold"
threshold determined by the shuffling algorithm
"shuffling_simulation_output"
output from the shuffling function if shuffling==TRUE
prepare_db
, get_observed_pairs
, Bonferroni_m
, adjust_visits
, Shuffling_simulation
1 2 3 4 5 | data("simulated_data")
pairs <- find_pairs(simulated_data,
ids_column = "subject",
dates_column = "sim_dates",
shuffling = TRUE, n_shuffl = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.