lotrrs | R Documentation |

Estimates a ratio of relative risk surfaces and computes the asymptotic p-value surface for a single gate with two conditions. Includes features for basic visualization. This function is used internally within the `gating`

function to extract the points within the significant areas. This function can also be used as a standalone function.

lotrrs( dat, bandw = NULL, alpha = 0.05, p_correct = "none", nbc = NULL, plot_gate = FALSE, save_gate = FALSE, name_gate = NULL, path_gate = NULL, rcols = c("#FF0000", "#CCCCCC", "#0000FF"), lower_lrr = NULL, upper_lrr = NULL, c1n = NULL, c2n = NULL, win = NULL, ..., doplot = lifecycle::deprecated(), verbose = lifecycle::deprecated() )

This function estimates a ratio of relative risk surfaces and computes the asymptotic p-value surface for a single gate with two conditions using three successive `risk`

functions. A relative risk surface is estimated for Condition A at each level of Condition B, and then a ratio of the two relative risk surfaces is computed.

*RR_{Condition B1} = \frac{Condition A2 of B1}{Condition A1 of B1}*

*RR_{Condition B2} = \frac{Condition A2 of B2}{Condition A1 of B2}*

*ln(rRR) = lnâ‰¤ft (\frac{RR_{Condition B2}}{CRR_{Condition B2}}\right )*

The p-value surface of the ratio of relative risk surfaces is estimated assuming asymptotic normality of the ratio value at each gridded knot. The bandwidth is fixed across all layers. Basic visualization is available if `plot_gate = TRUE`

.

Provides functionality for a correction for multiple testing. If `p_correct = "FDR"`

, calculates a False Discovery Rate by Benjamini and Hochberg. If `p_correct = "uncorrelated Sidak"`

, calculates an independent Sidak correction. If `p_correct = "uncorrelated Bonferroni"`

, calculates an independent Bonferroni correction. If `p_correct = "correlated Sidak"`

or if `p_correct = "correlated Bonferroni"`

, then the corrections take into account the into account the spatial correlation of the surface. (NOTE: If `p_correct = "correlated Sidak"`

or if `p_correct = "correlated Bonferroni"`

, it may take a considerable amount of computation resources and time to calculate). If `p_correct = "Adler and Hasofer"`

or if `p_correct = "Friston"`

, then calculates a correction based on Random Field Theory. If `p_correct = "none"`

(the default), then the function does not account for multiple testing and uses the uncorrected `alpha`

level. See the internal `pval_correct`

function documentation for more details.

The two condition variables (Condition A and Condition B) within `dat`

must be of class 'factor' with two levels. The first level in each variable is considered the numerator (i.e., "case") value, and the second level is considered the denominator (i.e., "control") value. The levels can also be specified using the `c1n`

and `c2n`

parameters.

An object of class 'list' where each element is a object of class 'rrs' created by the `risk`

function with two additional components:

`rr`

An object of class 'im' with the relative risk surface.

`f`

An object of class 'im' with the spatial density of the numerator.

`g`

An object of class 'im' with the spatial density of the denominator.

`P`

An object of class 'im' with the asymptotic p-value surface.

`lrr`

An object of class 'im' with the log relative risk surface.

`alpha`

A numeric value for the alpha level used within the gate.

test_lotrrs <- lotrrs(dat = randCyto)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.