qtcatPheno: A phenotype object constructor

Description Usage Arguments Examples

View source: R/associationTest.R

Description

Constructs an S3-object containing phenotype and if additional covariats exist a design matrix of those. The phenotype object is needed as input for qtcatHit.

Usage

1
qtcatPheno(names, pheno, family = "gaussian", covariates = NULL)

Arguments

names

a vector of individual names of length 'n'.

pheno

a vector of length 'n' or a matrix size 'n x 2' in case of binomial family. This contains the phenotypic observations.

family

a character string specifying the family of the phenotype distribution. Either "gaussian" (default) or "binomial".

covariates

a matrix typically generated by a call of model.matrix. It contain additional variables influencing the phenotype e.g. environmental and experimental covariates.

Examples

1
2
3
4
5
6
7
8
# file containing example data for a phenotype.
pfile <- system.file("extdata/phenodata.csv", package = "qtcat")
pdat <- read.csv(pfile, header = TRUE)

# Construct phenotype object
pheno <- qtcatPheno(names = pdat[, 1],
                    pheno = pdat[, 2],
                    covariates = model.matrix(~ pdat[, 3]))

QTCAT/qtcat documentation built on April 20, 2021, 11:20 p.m.