perm_score: Permutation of GLM-based Score Statistics

Description Usage Arguments Value See Also Examples

View source: R/perm_score.R

Description

This function calculates and permutes GLM-based score statistics.

Usage

1
perm_score(Y, X, binary = FALSE, cov = NULL, nperm = 1000, seed = NULL)

Arguments

Y

Response Variable. A vector or length n (the number of samples).

X

Explanatory Variables to be tested. A matrix with dimensions n by K (the number of explanatory variables to be tested).

binary

Indicator of whether Y is binary.

cov

Covariates. A matrix with dimensions n (number of subjects) by J (the number of explanatory variables that are not to be tested).

nperm

Number of permutations. Default is 1,000.

seed

Specify the seed for permutations.

Value

A list object.

Us

Score statistics. The first column contains the original data.

pvs

P-values of two-tailed score tests; can be further used by AF_combine function.

pvs_left

Left-side P-values of one-tailed score tests; can be further used by AF_combine function.

See Also

set.seed

Examples

1
2
3
4
Y <- ar_dense$trait
X <- ar_dense$methyl
result <- perm_score(Y, X, binary = TRUE, nperm = 100)
names(result)

cxystat/AFb documentation built on June 17, 2021, 7:30 p.m.