Get_Logistic_Weights: Get the logistic weight

View source: R/Function.R

Get_Logistic_WeightsR Documentation

Get the logistic weight

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


	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



data(SKAT.example)


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

# Use logistic weight
Z<-SKAT.example$Z
obj<-SKAT_Null_Model(y.c ~ X, out_type="C", data=SKAT.example)
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)



SKAT documentation built on Jan. 15, 2023, 5:10 p.m.