test_ENZ: test_ENZ

View source: R/MODULE_5_TER_ALT.R

test_ENZR Documentation

test_ENZ

Description

Function to calculate p-values by empirical null hypothesis testing.

Usage

test_ENZ(x, zcols, enz, method = "fit", keep_data = TRUE)

Arguments

x

Regression fit object produced by logit_seq with option long_output = TRUE, or any data frame or matrix containing a column or columns of test statistics (z).

zcols

Column(s) in x containing test z statistics.

enz

A vector of z values constituting empirical null e.g. produced by generate_ENZ.

method

Can be "direct" or "fit". "direct": two-sided p-value of a z is calculated as the percentage of ENZ larger than abs(z) or smaller than -abs(z). "fit": a normal distribution is fitted to the empirical null and is used to obtain two-sided p-values. Default: "fit".

keep_data

A logical variable indicating the original data set should be included in the output. If it is set to FALSE, only the empirical null p is reported back. Default: TRUE.

Details

Function logit_seq outputs regression coefficients and p-values by defaults. Option long_output = TRUE adds SD(beta) and z columns to the output matrix.

Value

Vector(s) of p-values calculated from an empirical null, reported alone or appended to the original data set.

Examples

fit1_LMCN_ENZ_p <- test_ENZ(x = fit1_LMCN, enz = rr_LMCN.v2.enz, zcols = 7)

goodarzilab/Ribolog documentation built on Oct. 7, 2022, 10:14 p.m.