perm_score: Score Statistics Permutation

Description Usage Arguments Value See Also Examples

View source: R/perm_score.R

Description

This function generates correlated score statistics by permutation.

Usage

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

Arguments

Y

Phenotype data. It can be a continuous trait or a binary trait. A vector or length n (number of subjects).

X

Genotype data. A matrix with dimensions n (number of subjects) by K (number of variants). If elements within a column of X are identical, this column needs to be removed ahead.

binary

Indicator of whether Y is binary.

cov

Covariates. A matrix with dimensions n (number of subjects) by J (number of covariates).

nperm

Number of permutations. Default is 1,000.

seed

Specify 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 wAF_combine function.

pvs_left

Left-side P-values of one-tailed score tests; can be further used by wAF_combine, wAFd_combine functions.

See Also

set.seed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# binary trait
Y <- RV_dense$trait
X <- RV_dense$SNV[, -RV_dense$zero_var]
result <- perm_score(Y, X, binary = TRUE, nperm = 100)
names(result)

# continuous trait
Y <- SNV_sparse$trait
X <- SNV_sparse$SNV[, -SNV_sparse$zero_var]
result <- perm_score(Y, X, nperm = 100)
names(result)

songbiostat/wAF documentation built on Feb. 26, 2021, 6:24 p.m.