Skip to contents

Haplotype Trend Regression

Usage

htr(y, x, n.sim = 0L)

Arguments

y

Numeric phenotype vector.

x

Haplotype dosage matrix.

n.sim

Number of permutations (default 0).

Value

A list with the following components:

f Overall F statistic for global haplotype association.

p P-value for the overall test (asymptotic or permutation-based).

fv Vector of F statistics for individual haplotypes.

pi Vector of p-values for individual haplotypes.

Details

Performs haplotype trend regression (HTR) with optional permutation testing. The method follows Zaykin et al. (2002) .

The model fits a linear regression of phenotype on haplotype dosage indicators and computes:

  • Overall F statistic for joint haplotype effects

  • Individual haplotype F statistics

  • Optional permutation-based p-values for both

Permutation p-values are computed using \((b + 1) / (B + 1)\) to avoid zero-valued estimates.

References

Zaykin DV, Westfall PH, Young SS, Karnoub MA, Wagner MJ, Ehm MG (2002). “Testing association of statistically inferred haplotypes with discrete and continuous traits in samples of unrelated individuals.” Hum Hered, 53(2), 79-91. doi:10.1159/000057986 .

Xie R, Stram DO (2005). “Asymptotic equivalence between two score tests for haplotype-specific risk in general linear models.” Genetic Epidemiology, 29(2), 166-170. doi:10.1002/gepi.20087 .

Examples

if (FALSE) { # \dontrun{
## 26-10-2003
## This example is now part of the demo.
if (!requireNamespace("gap.examples", quietly = TRUE))
    remotes::install_github("jinghuazhao/R/gap.examples")

filespec <- file.path(
    find.package("gap.examples"),
    "tests", "htr", "test2.dat"
)
test2 <- read.table(filespec)
y <- test2[, 1]
x <- test2[, -1]
y <- as.matrix(y)
x <- as.matrix(x)
htr.test2 <- htr(y, x)
htr.test2
htr.test2 <- htr(y, x, n.sim = 10)
htr.test2

## 13-11-2003
library(gap.datasets)
data(apoeapoc)

apoeapoc.gc <- gc.em(apoeapoc[, 5:8])
y <- apoeapoc$y
y[y == 2] <- 1

htr(y, apoeapoc.gc$htrtable)

## 20-08-2008
## Part of the useR! 2008 tutorial by Andrea Foulkes.
## The approach may be used beyond the generalized linear
## model (GLM) framework.
HaploEM <- haplo.em(Geno, locus.label = SNPnames)
HapMat <- HapDesign(HaploEM)

m1 <- lm(Trait ~ HapMat)
m2 <- lm(Trait ~ 1)

anova(m2, m1)
} # }