| .get_p_value | R Documentation |
Internal function to calculate p-values from cumulative distribution functions based on test statistics and alternative hypothesis specifications.
.get_p_value(
cdf,
test_stat,
params,
alternative = c("two-sided", "less", "greater")
)
cdf |
Cumulative distribution function |
test_stat |
Numeric test statistic value |
params |
List of distribution parameters |
alternative |
Character string specifying alternative hypothesis ("two-sided", "less", "greater") |
This function calculates p-values using the appropriate tail(s) of the distribution: - "greater": Uses upper tail (1 - CDF) - "less": Uses lower tail (CDF) - "two-sided": Uses 2 * minimum of both tails # Calculate p-value (internal use) # pval <- .get_p_value(pnorm, 1.96, list(mean=0, sd=1), "two-sided")
Numeric p-value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.