leveneTests_per_SNP {gJLS2}R Documentation

Levene's test for variance homogeneity by SNP genotypes (sex-specific p-values)

Description

This function takes as input the genotype of a SNP (geno_one), the genetic sex (SEX), a quantitative trait (Y) in a sample population. The function then returns the variance heterogeneity p-values for each sex and the overall variance heterogeneity signal using Fisher's method by combining the sex-specific results.

Usage

leveneTests_per_SNP(
  geno_one,
  SEX = NULL,
  Y,
  centre = "median",
  transformed = TRUE
)

Arguments

geno_one

the genotype of a bi-allelic SNP, must be a vector of 0, 1, 2's coded for the number of reference allele. Alternatively, for imputed genotypes, it could be a matrix/vector of dosage values, numerically between 0 and 2. The length/dimension of geno_one should match that of Y, and/or SEX and COVAR.

SEX

optional: the genetic sex of individuals in the sample population, must be a vector of 1 and 2 following the default sex code is 1 for males and 2 for females in PLINK.

Y

a vector of quantitative traits, such as human height.

centre

a character indicating whether the absolute deviation should be calculated with respect to "median" or "mean", the default option is "median".

transformed

a logical indicating whether the quantitative response Y should be transformed using a rank-based method to resemble a normal distribution; recommended for traits with non-symmetric distribution. The default option is TRUE.

Value

a vector of Levene's test p-values according to levels specified by geno_one in each sex and the Fisher's method to combine the sex-specific Levene's test p-values.

Note

We recommend to quantile-normally transform Y to avoid ‘scale-effect’ where the variance values tend to be proportional to mean values when stratified by G.

Author(s)

Wei Q. Deng deng@utstat.toronto.edu, Lei Sun sun@utstat.toronto.edu

References

Levene H. (1960) Robust tests for equality of variances. In Contributions to Probability and Statistics: Essays in Honor of Harold Hotelling eds:I. Olkin, S.G. Ghurye, W. Hoeffding, W.G. Madow & H.B.Mann, pp.278-292. Stanford: Stanford University Press.

Examples

N <- 5000
sex <- rbinom(N, 1, 0.5)+1
genDAT <- rbinom(N, 2, 0.3)
y <- rnorm(N);

genDAT[sex==2] <- rbinom(sum(sex==2), 1, 0.3)
table(genDAT, sex)
leveneTests_per_SNP(geno_one=genDAT, SEX=sex, Y=y^2, transform=TRUE)

genDAT[sex==2] <- rbinom(sum(sex==2), 1, 0.01)
table(genDAT, sex)
leveneTests_per_SNP(geno_one=genDAT, SEX=sex, Y=y^2, transform=FALSE)

leveneTests_per_SNP(geno_one=rep(0, N), SEX=sex, Y=y^2, transform=TRUE)
leveneTests_per_SNP(geno_one=rep(0, N), Y=y^2, transform=TRUE)



[Package gJLS2 version 0.2.0 Index]