smt: Single-marker test

Description Usage Arguments Details Value Author(s) References Examples

View source: R/SMT_main.R

Description

Conduct the single-marker test in an association study to test for the association between the genotype at a biallelic marker and a trait.

Usage

1
2
3
4
5
6
7
8
smt(
  y,
  g,
  covariates = NULL,
  min.count = 5,
  missing.rate = 0.2,
  y.continuous = FALSE
)

Arguments

y

a numeric vector of the observed trait values in which the ith element is for the ith subject. The elements could be discrete (0 or 1) or continuous. The missing value is represented by NA.

g

a numeric vector of the observed genotype values (0, 1, or 2 denotes the number of risk alleles) in which the ith element is for the ith subject. The missing value is represented by NA. g has the same length as y.

covariates

an optional data frame, list or environment containing the covariates used in the model. The default is NULL, that is, there are no covariates.

min.count

a critical value to decide which method is used to calculate the p-value when the trait is discrete and covariates = NULL. If the minimum number of the elements given a specific trait value and a specific genotype value is less than min.count, the Fisher's exact test is adopted; otherwise, the Wald test is adopted. The default is 5.

missing.rate

the highest missing value rate of the genotype values that this function can tolerate. The default is 0.2.

y.continuous

logical. If TRUE, y is continuous; otherwise, y is discrete. The default is FALSE.

Details

Single-marker analysis is a core in many gene-based or pathway-based procedures, such as the truncated p-value combination and the minimal p-value.

Value

smt returns a list with class "htest".

If y is continuous, the list contains the following components:

statistic
the observed value of the test statistic.
p.value
the p-value for the test.
alternative
a character string describing the alternative hypothesis.
method
a character string indicating the type of test performed.
data.name
a character string giving the names of the data.
sample.size
a vector giving the numbers of the subjects with the genotypes 0, 1, and 2 (n0,
n1, and n2, respectively).

If y is discrete, the list contains the following components:

statistic
the observed value of the test statistic.
p.value
the p-value for the test.
alternative
a character string describing the alternative hypothesis.
method
a character string indicating the type of test performed.
data.name
a character string giving the names of the data.
sample.size
a vector giving
the number of subjects with the trait value 1 and the genotype 0 (r0),
the number of subjects with the trait value 1 and the genotype 1 (r1),
the number of subjects with the trait value 1 and the genotype 2 (r2),
the number of subjects with the trait value 0 and the genotype 0 (s0),
the number of subjects with the trait value 0 and the genotype 1 (s1),
and the number of subjects with the trait value 0 and the genotype 2 (s2).
bad.obs
a vector giving the number of missing genotype values with the trait value 1
(r.miss), the number of missing genotype values with the trait value 0
(s.miss), and the total number of the missing genotype values (n.miss).

Author(s)

Lin Wang, Wei Zhang, and Qizhai Li.

References

Lin Wang, Wei Zhang, and Qizhai Li. AssocTests: An R Package for Genetic Association Studies. Journal of Statistical Software. 2020; 94(5): 1-26.

Examples

1
2
3
4
y <- rep(c(0, 1), 25)
g <- sample(c(0, 1, 2), 50, replace = TRUE)
smt(y, g, covariates = NULL, min.count=5,
        missing.rate=0.20, y.continuous = FALSE)

Example output

Loading required package: cluster
Loading required package: mvtnorm
Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: fExtremes
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics
Loading required package: fGarch

	Single-marker test

data:  y and g
p-value = 0.4932
alternative hypothesis: the phenotype is significantly associated with the genotype

AssocTests documentation built on Jan. 13, 2021, 5:09 a.m.

Related to smt in AssocTests...