calc_sig_ind: Returns the significance codes the R shows in regression...

View source: R/calc_sig_ind.R

calc_sig_indR Documentation

Returns the significance codes the R shows in regression output.

Description

Signif. codes: ⁠0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1⁠

Usage

calc_sig_ind(p_value, html = TRUE)

Arguments

p_value

A p-value or vector of p-values. Can handle numeric or characters with text.

html

Logical; if TRUE, escapes character suitable for markdown, else suitable for pdf or word.

Value

A character value or vector

Examples

library(dplyr)

pvals <- c(.133213, .06023, .004233, .000000134234, 1.0)
pvals_2 <- c(.133213, .06023, .004233, .000000134234, NA)
calc_sig_ind(pvals)
calc_sig_ind(pvals_2)

df <- tibble::tibble(p = pvals,
                     p_2 = pvals_2)

df %>%
  mutate(p_sig = calc_sig_ind(p),
         p_2_sig = calc_sig_ind(p_2)
  )


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.