determine_n_permutations: Estimate, based on initial p-values, the number of permut

View source: R/workflow_utils.R

determine_n_permutationsR Documentation

Estimate, based on initial p-values, the number of permut

Description

This function estimates, based on the number of leading 0's in an initial p-value, how many permutations will be needed to calculate an empirical p-value out to the user-specified number of significant figures

Usage

determine_n_permutations(leading_0s, desired_sig_figs)

Arguments

leading_0s

An integer for the number of 0's between the decimal point and the first nonzero value in the maximum p-value for SNP windows that will be included in the subset of interest

desired_sig_figs

An integer for the number of significant figures the user desires for empirical p-values

Value

An integer, representing the number of permutations expected to be needed to calculate an empirical p-value with the desired level of accuracy

Examples

# 10,000 permutations should be needed to calculate p-values below 0.01
# (e.g. 0.0095 has two leading 0's) out to two significant figures
determine_n_permutations(leading_0s = 2, desired_sig_figs = 2)

naglemi/mtmcskat documentation built on Aug. 23, 2023, 5:35 p.m.