Get_Logistic_Weights: Get the logistic weight

Description Usage Arguments Details Value Author(s) Examples

View source: R/Function.R

Description

Get logistic weights from either a genotype matrix (Z) or a vector of minor allele frequncies (MAF). Users can apply this weights to SKAT by giving it as the “weights” parameter. The logistic weight gives equal weights to rare variants and nearly zero weight to common variants.

Usage

1
2
3
4
5
6
	Get_Logistic_Weights(Z, par1=0.07, par2=150)


	Get_Logistic_Weights_MAF(MAF, par1=0.07, par2=150)
		
 

Arguments

Z

a numeric genotype matrix with each row as a different individual and each column as a separate gene/snp. Each genotype should be coded as 0, 1, 2, and 9 for AA, Aa, aa, and missing, where A is a major allele and a is a minor allele.

MAF

a numeric vector of minor allele frequncies.

par1

a numeric value of the first parameter of the logistic weight (default= 0.07).

par2

a numeric value of the second parameter of the logistic weight(default= 150).

Details

The formula for the weight is

weights = \frac{e^{(par1 - MAF) par2}}{1 + e^{(par1 - MAF) par2}}.

Value

A vector of the logistic weight.

Author(s)

Seunggeun Lee

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(SKAT.example)
attach(SKAT.example)


#############################################################
#	Compute the P-value of SKAT with the logistic Weight (par1=0.07, par2=150)

# Use logistic weight
obj<-SKAT_Null_Model(y.c ~ X, out_type="C")
weights<-Get_Logistic_Weights(Z, par1=0.07, par2=150)
SKAT(Z, obj, kernel = "linear.weighted", weights=weights)$p.value

# Weights function
MAF<-colMeans(Z)/2
plot(MAF,weights)

lin-lab/SKAT documentation built on May 29, 2019, 3:41 a.m.