get_signif_code is a helper function for model_gam and model_gamm to create an easy-to-read output for the significance of the smoothing term in the GAM(M)s (shown in the signif_code column of the output tibbles).

get_signif_code(p_val)

Arguments

p_val A vector with the p-values of the smoothing term.

Value

The function returns a character vector of the same length then the input vector, with one symbol for each p-value.

Details

The following code is adopted from summary.gam:

 " " = not significant (> .1) "." = close to significant (.05 < .1) "*" = significant (.01 < .05) "**" = highly significant (.001 < 0.01) "***" = absolute significant (<= .001)

model_gam, model_gamm

Examples

x <- tibble::tibble(p_val = list("test", NA, runif(1, 0, .1), runif(1, 0, .01)))
x$code <- get_signif_code(x$p_val)