Description Usage Arguments Value Examples
This method is much faster than the shuffling method, but less precise.
1 2 3 4 5 | Bonferroni_m(unadjusted_pairs,
ids=ids,
prob = 1/75,
alpha = 0.01,
only_significant = TRUE)
|
unadjusted_pairs |
a |
ids |
a |
prob |
probability of sharing a single visit. Default |
alpha |
type I error |
only_significant |
returns only significant pairs above the threshold (default) or all the pairs |
a data frame with
"allPairs"
pair identifier
"Freq"
the unadjusted number of shared visits
"id_1"
identifier of the first pair member
"id_2"
identifier of the second pair member
"N_visits.x"
total number of visits of the first pair member
"N_visits.y"
total number of visits of the second pair member
"Prob_for_Bonferr"
probability of sharing the given number of shared visits
"BP"
row number
"ltp"
the minus log10-transformed probablity of sharing the given number shared visits
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # load data
data("simulated_data")
db_dates <- prepare_db(your_database = simulated_data,
ids_column = "subject",
dates_column = "sim_dates")
# first get unadjusted pairs
unadjusted_observed_pairs <- get_observed_pairs(db_dates)
# prepare ids
ids <- data.table(ids = as.character(names(table(db_dates$subject))),
N_visits = as.character(as.numeric(table(db_dates$subject))))
setkey(ids, "ids")
# run
Bonferroni_m_output <- Bonferroni_m(unadjusted_observed_pairs,
ids = ids, prob = 1/75, alpha = 0.01)
# number of significant pairs
nrow(Bonferroni_m_output)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.