Description Usage Arguments Details Value See Also Examples
View source: R/statTools_code_OTHER.R
Rounding significant p-values to the first non-zero decimal number and non-significant to two decimal places.
1 |
pval |
Vector or matrix of p-values to be rounded. |
show.sig.stars |
Default to FALSE. TRUE for displaying stars, dots or nothing depending on the significance of the p-value. |
alpha |
Default to 0.05. Threshold for significance. |
P-values below 0.00001 are displayed as "<0.00001"
. This is the default function for rounding p-values.
In case of confusion when the rounding returns exactly the value alpha, another decimal place is given.
This can be changed in options("p.value.rounding")
, with is a list where the first element is the name
of the function as a string, and the other elements, the parameters to pass to this function.
An object with the same class of pval, with all the p-values properly rounded and returned as strings.
1 2 3 4 5 6 7 8 9 10 11 | pvalue(c(0.684736, 0.06543, 0.05146673, 0.05042, 0.049831, 0.04395,
0.0232, 0.0266, 0.0001235, 0.000000124527))
pvalue(c(0.684736, 0.06543, 0.05146673, 0.05042, 0.049831, 0.04395,
0.0232, 0.0066, 0.0001, 0.0001235, 0.000000124527), show.sig.stars = TRUE)
pvalue(c(0.684736, 0.16543, 0.10146673, 0.10042, 0.09949831, 0.0904395,
0.0910232, 0.090266, 0.04001235, 0.0002546, 0.000000124527), alpha = 0.1)
## Not run:
# Use stars as a default option when calling pvalue() from another function such as bivarTable().
options("p.value.rounding" = list("pvalue", show.sig.stars = TRUE))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.