Compute the p-value based on the check result
Source:R/zzz_auto_visual_inference.R
AUTO_VI-cash-p_value.Rd
This function computes the p-value of observing the visual signal strength of the original residual plot based on the null distribution.
Arguments
- type
Character. Either "auto", "quantile" or "lineup". Option "auto" will use the Boolean flag
self$check_result$lineup_check
to determine the correct option.
Details
There are two types of p-value calculation. Option "quantile" calculates the percentage of null visual signal strength greater than or equal to the observed visual signal strength. Option "lineup" combines the null visual signal strength and the observed visual signal strength in one vector, and calculates the percentage of entries in this vector greater than or equal to the observed visual signal strength. The "lineup" option ensures the p-value will not be smaller than 1 over the size of the lineup.
Examples
vss <- 1
null_dist <- rnorm(100, 0, 1)
AUTO_VI$p_value(vss, null_dist)
#> [1] 0.17